Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to find sheetmetal Mark contour in flat pattern?

2 REPLIES 2
Reply
Message 1 of 3
miechh
72 Views, 2 Replies

How to find sheetmetal Mark contour in flat pattern?

In our sheetmetal parts we use the Mark-tool to create an identification text that wil be engraved. This Mark-feature is created and placed in the Folded Model. In the Flat Pattern this identification is of course visible as a consequence. Our sheetmetal supplier wants to have DXF files in which the flat-pattern is visible but also wants two or three views of the folded model, if folds are present. We created a VBA macro that finds all sheetmetal parts in an assembly, creates Inventor-dwg files in which the flat-pattern and, if necessary, the views of the folded model are placed. These dwg files will then be exported as final DXF-files by the use of another macro.

 

Now, the problem is, the contourlines of the Marking features in all views are all put in the "Visible (ISO)"-layer. I'd like to have all lines that are created by Mark-features in the views of the folded model as well as in the view with the flat-pattern be put in the "Laser Engraving"-layer instead.

 

I tried to create a VBA program in which I can select the flat-pattern-view and iterate through all edges found, but I guess there's no way to find out to which feature those countless edges belong.

 

Is there a way in VBA/iLogic to find the Mark features of the folded sheetmetal-document displayed on the dwg, have the associated contourlines of the Mark features selected (for both folded- and flat-pattern views!) and put in the "Laser Engraving"-layer?

 

Help is greatly appreciated. I've put two files in this message, the dwg contains both the flat-pattern view and the projections of the folded model.

 

Mark feature in Folded ModelMark feature in Folded ModelMark feature created in Folded Model, in Flat PatternMark feature created in Folded Model, in Flat Pattern


Product Design Suite 2024
Inventor 2024 (v 28.20.27200.0000), Vault Basic 2024
Fusion 360
HP Workstation Z4
Intel Xeon 3.4GHz
32GB RAM
Windows 10 Professional (64bit)
2 REPLIES 2
Message 2 of 3
fullevent
in reply to: miechh

Hi @miechh,

 

very interesting challenge.
Unfortunately, I have not found a solution yet.
The assignment is relatively easy in the part. The CreatedbyFeature property can be used to assign each edge or surface etc. to the feature used.

fullevent_0-1727277899159.png

 

If I try the same via the drawing and try to find out from which model feature, for example, a DrawingCurveSegment was created, then an error is stored as the value.

fullevent_1-1727278127716.png

 

A little frustrating. Maybe we'll find something else.

Best regards,


Aleksandar Krstic
Produkt- und Projektmanager

Message 3 of 3
WCrihfield
in reply to: fullevent

Hi @fullevent.  I am working on other stuff right now, so no time for testing on attached files, but a couple ideas come to mind that may help in this process.  Instead of getting all curves from the view, then working backwards, trying to figure out which feature in the model is responsible for them, try doing it the other way around.  When you use the DrawingView.DrawingCurves property, specify the MarkFeature as the 'model object' to input.  Then you should get all the view geometry belonging to that feature in one DrawingCurvesEnumerator.  Another thing to keep in mind is 'context' (or edit mode, if that makes more sense).  If the view is a flat pattern view, then the context of the model geometry associated with the 2D curves in that view will be in the flat pattern mode of the model file.  I'm not sure if you are aware of this or not, but the FlatPattern object is derived from the ComponentDefinition, so it is capable of having its own, separate set of parameters, features, and other such things.  When in 'folded' mode, you will not even see the parameters defined within the FlatPattern available within the Parameters dialog.  So, you may need to transition from scope of the FlatPattern into the 'folded' scope, before you can access the feature that was defined within the 'folded' mode.  If the feature was added in 'flat pattern' mode, then it would not be available in the 'folded' mode...unless you used fold/unfold features in the process, or something odd like that, maybe.  Just some food for thought.

Edit:  I should probably add this link in here too, to avoid confusion, because the 'folded' model of a sheet metal part is in the SheetMetalComponentDefinition (which is derived from the PartComponentDefinition, but is further customized for sheet metal stuff).  To get access to that type of 'definition', create a variable of that Type, then set the variable's value using the PartDocument.ComponentDefinition property, which just says that it returns a normal PartComponentDefinition, in the documentation.  But you will get the SheetMetalComponentDefinition type instead.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report