Easy Gadget Text Maker

This forum is for users to submit their own gadgets to the community

Easy Gadget Text Maker

Postby jimandi5000 » Wed Nov 13, 2019 5:45 pm

Hello All,

I have been reading the Forum and see a number of the members asking about how to put text, part numbers, etc on the drawing using a Gadget. I am working on more fonts but this font has been working for me.

Have a look and see if you can use it.
Attachments
EasyGadgetText.zip
(2.95 KiB) Downloaded 29 times
text1.jpg
text2.jpg
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 182
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Easy Gadget Text Maker

Postby zoner » Tue Dec 03, 2019 7:38 pm

I have modified it to manage group ... needed it ... and made it into a LUAX code library

Tell me what you think and thanks again for the great code base ! Saved hours !

Mike.
Attachments
EasyGadgetText.txt
Easy Gadget Text as a code library
(21.91 KiB) Downloaded 16 times
zoner
 
Posts: 14
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Easy Gadget Text Maker

Postby jimandi5000 » Tue Dec 03, 2019 10:59 pm

made it into a LUAX code library


Hi zoner,

Good to hear you could use the code. Tell me more about the LUAX code library???? I am building a web base code library to have a place to pull functions into my code.
Attachments
Annotation 2019-12-03 155745.jpg
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 182
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Easy Gadget Text Maker

Postby zoner » Wed Dec 04, 2019 2:58 am

if you want to include a code library using code like this :

-- add the code library path to the package path
-- then declare a variable to hold the library (Utils in this case)
-- then use the functions in it

package.path = package.path .. ";" .. path .. "\\..\\_CodeLibrary\\?.luax"
local Utils = require("CodeLibraryName")
Utils.AfunctionDefinedInTheLibrary()

to do so ... in the code library file, I add the following at the beginning

local CodeLibraryName = {}

and those at the end

package.loaded.CodeLibraryName = CodeLibraryName
return CodeLibraryName

and every function that you want to make public you define as follows

function CodeLibraryName.AddGroupToLayer(TheJob, TheGroup, LayerName)
local cad_object = CreateCadGroup(TheGroup);
local layer = TheJob.LayerManager:GetLayerWithName(LayerName)
layer:AddObject(cad_object, true)
end

starting the function name with your "CodeLibraryName." to make it exported ... or something like that ...

I then finally change the file extension to .luax to differentiate them from normal lua files ... that and I saw an example and I copied what made it work lol

Mike.
zoner
 
Posts: 14
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Easy Gadget Text Maker

Postby jimandi5000 » Wed Dec 04, 2019 5:58 pm

This is very cool... The only issue I see, I would need to share the code library when I post gadgets in the forum.

How do you handle this?
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 182
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Easy Gadget Text Maker

Postby zoner » Wed Dec 04, 2019 6:21 pm

I don't follow ...

When I build software, I usually organise it ... I always have a code library for code that is not specific to the current problem ... I organise them in types of functionnality it has ... or offers ... a file per concept say ... yours is called EasyGadgetWriter ... self contained :)

If you post gadgets that have some code in some library then you need to post the code library too ... it usually is in a directory ... simply zip it and add it to your post ... no ? Or I am missing the point and you are talking about your code library extractor ? You just need to make sure all dependencies are satisfied non ? So If someone wants to have a gadget that has some code library, you need a way to know about the dependencies (they are usually found by the imports or the require) ... and extract those too ...

Does that help ? Or I am missing the point !
zoner
 
Posts: 14
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Easy Gadget Text Maker

Postby jimandi5000 » Wed Dec 04, 2019 7:43 pm

Hi Mike,

I sent you a email...
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 182
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120


Return to Gadgets - User Submissions

Who is online

Users browsing this forum: ElevationCreations and 1 guest