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: 1450
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: 72
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: 1450
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: 72
Joined: Mon Mar 05, 2018 12:34 pm
Model of CNC Machine: None

Re: Creating a text object in a gadget

Postby zoner » Mon Nov 11, 2019 9:09 pm

I have the same need ... adding text to identify what part was read and built ...

I feed a CSV file from Excel which discribes a full wall with sections of angled panels ... the file contains the size of each panel.

I need to add the name of the part (which is in the CSV file) to the drawing to identify it ... I normally group the text with the part ...

Tried the markers but since you cannot select them they are useless ...

Where is the CreateText API ?
zoner
 
Posts: 14
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Creating a text object in a gadget

Postby Adrian » Mon Nov 11, 2019 9:43 pm

zoner wrote:Where is the CreateText API ?

There isn't an API for every part of Cut2D/VCarve/Aspire. Some things you need to create your own code.

Why is not being able to select the markers a problem?
User avatar
Adrian
Vectric Archimage
 
Posts: 9804
Joined: Thu Nov 23, 2006 2:19 pm
Location: Surrey, UK
Model of CNC Machine: ShopBot PRS Alpha 96x48

Re: Creating a text object in a gadget

Postby zoner » Tue Nov 12, 2019 4:20 am

Because I need to associate it to the panel shape and move both on sheets one per sheet ... the wall is about 8 feet high and 50 feet wide ... each acoustic panel is maximum 4 feet wide and 8 feet high ... so the wall has about 20 panels ... each one a specific size and shape ... so attaching a label to the panel shape is mandatory ...
zoner
 
Posts: 14
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Creating a text object in a gadget

Postby jimandi5000 » Tue Nov 12, 2019 5:40 am

zoner wrote:I have the same need ... adding text to identify what part was read and built ...

I feed a CSV file from Excel which discribes a full wall with sections of angled panels ... the file contains the size of each panel.

I need to add the name of the part (which is in the CSV file) to the drawing to identify it ... I normally group the text with the part ...

Tried the markers but since you cannot select them they are useless ...

Where is the CreateText API ?



Hi Zoner,

I have a Gadget that puts real vector based letters and numbers on the drawing. I use them on my CNC mill to laser burn part ID numbers on my parts. See the image and let me know if this is what you are looking for?
Attachments
Finger1.jpg
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 162
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Creating a text object in a gadget

Postby zoner » Wed Nov 13, 2019 1:32 am

Hi Jim,

Yes I would be interested to look at the code and probably use it in my own to add text to panel shapes which could be "selected" automatically (meaning by code) and then grouped. Is it formatted as a function call ? position, text and size ? How can we go about it ?

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

Re: Creating a text object in a gadget

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

Hi Mike,
Here is where I posted the code.

https://forum.vectric.com/viewtopic.php?f=51&t=33272

Have a look and I would live to see how you use it.
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 162
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Creating a text object in a gadget

Postby zoner » Wed Nov 27, 2019 6:11 pm

I just got the code ... sorry for the delay ... life ...

I looked at the code and it seems fine, passing it the layer name and all ... super cool !

I will transform it a tad ... to make it a luax file ... I'll post it on the other link you gave me when done ? Having a code library is helpfull sometimes lol

Why all on one lines separated with semi-comas ? I usually document everything ... at the end of a line lol will be difficult to keep it like that lol I understand the appealing view of one line per letter though ... will think it through, probably render the said line to a function call ... and keep it a one liner per letter ...

But great many thanks for the code ! I will save a lot of time with this ... no manual entry and easy grouping from code ... the object and its label ... one shot ! So again, thanks !

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


Return to Gadgets - General

Who is online

Users browsing this forum: No registered users and 2 guests