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.
Easy Gadget Text Maker
- jimandi5000
- Vectric Wizard
- Posts: 1056
- 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
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.
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 246 times
- jimandi5000
- Vectric Wizard
- Posts: 1056
- 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
Hi zoner,made it into a LUAX code library
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.
Thanks,
Jim
Jim
Re: Easy Gadget Text Maker
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.
-- 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.
- jimandi5000
- Vectric Wizard
- Posts: 1056
- 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
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?
How do you handle this?
Thanks,
Jim
Jim
Re: Easy Gadget Text Maker
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 !
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 !
- jimandi5000
- Vectric Wizard
- Posts: 1056
- Joined: Wed Mar 11, 2015 6:50 pm
- Model of CNC Machine: Home Made 60 x 120
- Location: North Houston Tx.
- Contact: