Export uncomsumed sketch in DXF

Export uncomsumed sketch in DXF

arneYNQZM
Explorer Explorer
405 Views
6 Replies
Message 1 of 7

Export uncomsumed sketch in DXF

arneYNQZM
Explorer
Explorer

Hi,

 

I'm trying to automate the DXF-export a small assembly of sheetmetal parts. 

 

I've managed to create an assembly that configures dimensional and that lets me control the needed Iproperties and custom properties. Also, I added a rule and form to export the flat patterns in a DXF, to the right path on our server, with the right name.

 

But, there is a part that I don't get to work and I'm clueless where to search.. 

 

Our lasercutters in the factory can engrave, and so I want to export a text in my DXF, containing Iproperties "Project" & "-" & "Stock number".  To achieve this manually isn't an issue. The steps to create an uncomsumed sketch and convert to geometrie and to export in a different layer and color are familiar.

 

The problem lies in sending the Iproperties to the unconsumed sketch and converting to geometrie with Ilogic. Hopefully someone has a tip or snippet..

 

Many thanks!

Arne

0 Likes
406 Views
6 Replies
Replies (6)
Message 2 of 7

basautomationservices
Advocate
Advocate

Hi Arne,

 

Maybe this will help. 

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/create-text-sketch-on-a-face-in-a-as...

 

This creates a sketch with text (in assembly, but this is easy to convert to a part sketch). Then all that is left is creating an emboss feature. I also found some threads about this:

 

https://forums.autodesk.com/t5/inventor-forum/embossing-feature-api/td-p/8637869 

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/embossed-text/td-p/5668061

Contact me for custom app development info@basautomationservices.com. Follow below links to view my Inventor appstore apps.

Free apps: Smart Leader | Part Visibility Utility | Mate Origins

Paid apps: Frame Stiffener Tool | Constrain Plane Toggle | Property Editor Pro


0 Likes
Message 3 of 7

arneYNQZM
Explorer
Explorer

Hi Bas,

 

Thanks for trying to awnser my question. Although it's not what I was looking for. As you mention, this code gets a textbox on my assembly and it can altered to get in on my .ipt files directly. 

Where I ran into was that I need the text in my flat pattern and then broken into geometrie to export it in separate layer as a single line text. With an Emboss the engraving will take the machine twice as long and I don't know (yet) how to separate the emboss from other interior profiles..

 

My problem lies in the getting the iproperties in an unconsumed sketch on an flat pattern and then converting it to geometrie.

 

Although, a different road to get the same result (a suitable DXF for our CAM) is, offcoarse fine aswell 🙂

 

As an unconsumed sketch, the line below does the exporting perfectly..

 

sOut = "FLAT PATTERN DXF?AcadVersion=2004&RebaseGeometry=True&UnconsumedSketchesLayer=1&UnconsumedSketchesLayerColor=255;255;0&OuterProfileLayer=0&OuterProfileLayerColor=0;0;0&InteriorProfilesLayer=0&InteriorProfilesLayerColor=0;0;0&InvisibleLayers=IV_ARC_CENTERS;IV_TANGENT;IV_ROLL;IV_ROLL_TANGENT;IV_ALTREP_BACK;IV_ALTREP_FRONT;IV_FEATURE_PROFILES_DOWN;IV_FEATURE_PROFILES;IV_TOOL_CENTER_DOWN;DIGI_MARKER_TOOL_1;DIGI_MARKER_TOOL_2;IV_BEND;IV_BEND_DOWN"

 

0 Likes
Message 4 of 7

basautomationservices
Advocate
Advocate

You mean you want to convert the text to lines/arcs? This is quite challenging and depending on fonts. I don't think there is anything available for this (correct me if I'm wrong anyone). Could be interesting to create it, but I wouldn't like to do this in iLogic.

 

I think you would have to create a class for each letter which defines the actual sketchlines/arcs, then have a class that takes care of converting your property string to your 'sketched' letters.

 

There is something in AutoCAD that does this (TXTEXP). It could also be an option to add the text (and explode it) in AutoCAD.

Contact me for custom app development info@basautomationservices.com. Follow below links to view my Inventor appstore apps.

Free apps: Smart Leader | Part Visibility Utility | Mate Origins

Paid apps: Frame Stiffener Tool | Constrain Plane Toggle | Property Editor Pro


0 Likes
Message 5 of 7

arneYNQZM
Explorer
Explorer

Hi,

 

Manually, it can be done;

 

  1. Create a Sketch on your flat pattern
  2. Make a text box in your Sketch, 
  3. Right-click the box and select 'Convert to Geometry'.
  4.  

    arneYNQZM_0-1651671461237.png

    choose 'txt' as font; it's a single line font so no double lines

  5. Close your sketch
  6. Right-click on the flat pattern in your browser an 'Save copy As'
  7. Make sure the wright layers are turned on;arneYNQZM_2-1651671649552.png

     

  8.  Hit 'OK' and save. 

If the layer for the unconsumed sketch is set up in a way the CAMsoftware interperetes the wright way, the DXF can be tooled an nested directly.

 

Steps to be taken in Ilogic are then:

  1. Open part from assy
  2. Activate flat pattern
  3. place sketch 
  4. add text (parametric!)
  5. convert text to geometry
  6. Close flat pattern and part and return to assy
  7. Run DXF export rule

Steps 4 and 5 is where my knowledge of VB and Ilogic falls short..

0 Likes
Message 6 of 7

basautomationservices
Advocate
Advocate

Sorry I did not know about this functionality at all... 

 

I see there is a function for it in the API as well:

https://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-191BB26A-2E95-40C8-BB92-63132BC035E8

 

in iLogic:

Dim prop1 = iProperties.Value("Project", "Project")
Dim prop2 = iProperties.Value("Project", "Stock Number")
Dim text = prop1 + " - " + prop2

Dim sk As Sketch = ThisDoc.Document.componentdefinition.sketches.item(1)
Dim point As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(0,0)
Dim tb = sk.TextBoxes.AddFitted(point, text)
tb.ConvertToGeometry("ITALIC8")

 

 

Contact me for custom app development info@basautomationservices.com. Follow below links to view my Inventor appstore apps.

Free apps: Smart Leader | Part Visibility Utility | Mate Origins

Paid apps: Frame Stiffener Tool | Constrain Plane Toggle | Property Editor Pro


0 Likes
Message 7 of 7

arneYNQZM
Explorer
Explorer

Thanks! I'm going to squeeze this in. I'll let you know how it ends up!