Easy Gadget Text Maker

This forum is for users to submit their own gadgets to the community
Post Reply
User avatar
jimandi5000
Vectric Wizard
Posts: 1046
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:

Easy Gadget Text Maker

Post by jimandi5000 »

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 294 times
text1.jpg
text2.jpg
Thanks,
Jim

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

Re: Easy Gadget Text Maker

Post by zoner »

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 241 times

User avatar
jimandi5000
Vectric Wizard
Posts: 1046
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:

Re: Easy Gadget Text Maker

Post by jimandi5000 »

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

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

Re: Easy Gadget Text Maker

Post by zoner »

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.

User avatar
jimandi5000
Vectric Wizard
Posts: 1046
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:

Re: Easy Gadget Text Maker

Post by jimandi5000 »

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

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

Re: Easy Gadget Text Maker

Post by zoner »

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 !

User avatar
jimandi5000
Vectric Wizard
Posts: 1046
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:

Re: Easy Gadget Text Maker

Post by jimandi5000 »

Hi Mike,

I sent you a email...
Thanks,
Jim

Post Reply