Creating a text object in a gadget

This section is for general discussion about Gadgets

Creating a text object in a gadget

Postby dealguy11 » Sun Jun 16, 2019 3:19 pm

I need to include the ability to create text in a gadget. Specifically what I'm trying to do is something like Paul RownTree's CSV to 2D gadget to create both geometry and text in an Aspire file. The purpose of the text is to serve as a label for a set of vectors which can then be grouped together and nested and will appear in the printout of each sheet of the job. The text will allow the CNC operator to figure out the identity of each group (in this case, an MDF door) and put a label on the finished product.

On page 55 of the Vectric LUA documentation, it includes the following sentence for the CadObject class: "The objects derived from CadObject can include polylines, groups, text, bitmaps, toolpath previews etc." There is nowhere else in the documentation that references how you would create a text object.

Has anyone done this?f

Note - if this isn't possible, I can continue to use the Plate Production feature of Aspire to get the text into the file, which is what I do today, but would love to eliminate this step.
Steve Godding
D&S Artistic Woodworking http://www.dsartisticwood.com
User avatar
dealguy11
Vectric Wizard
 
Posts: 1391
Joined: Tue Sep 22, 2009 9:52 pm
Location: Henryville, PA
Model of CNC Machine: Anderson Selexx 510

Re: Creating a text object in a gadget

Postby gregk » Mon Jun 17, 2019 8:57 am

Dear Steve,

Since you need the text only for the purpose of labelling, I would try using the CadMarker (page 63 in the Vectric LUA documentation).

I hope this helps,
Greg K
gregk
Vectric Staff
 
Posts: 50
Joined: Mon Mar 05, 2018 12:34 pm
Model of CNC Machine: None

Re: Creating a text object in a gadget

Postby dealguy11 » Mon Jun 17, 2019 7:50 pm

Ok, thanks. Just to clarify. Since this is described as not selectable, can it be nested?
Steve Godding
D&S Artistic Woodworking http://www.dsartisticwood.com
User avatar
dealguy11
Vectric Wizard
 
Posts: 1391
Joined: Tue Sep 22, 2009 9:52 pm
Location: Henryville, PA
Model of CNC Machine: Anderson Selexx 510

Re: Creating a text object in a gadget

Postby gregk » Tue Jun 18, 2019 9:05 am

Yes, markers cannot be selected and therefore nested. If the geometry is only being imported and then nested, there still may be a solution.
During the import the gadget can create both markers and geometry. Assuming there is a one label per imported part, you could use :SetInt() or :SetString() method (page 57-58) to store a "part id" - the same for the marker and object it refers to.
When the geometry is nested, each instance will have that parameter set as well. Then you would need to have another gadget that would run after nesting. This gadget would then locate each marker on the default sheet, read its "part id"
and then find each nested part that have the same "part id". After that it is only the question of placing a copy of that marker in some relation to the nested part.

Greg K
gregk
Vectric Staff
 
Posts: 50
Joined: Mon Mar 05, 2018 12:34 pm
Model of CNC Machine: None


Return to Gadgets - General

Who is online

Users browsing this forum: No registered users and 1 guest