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: 

Inventor Api 2023 Leader with parameter from subassembly

3 REPLIES 3
Reply
Message 1 of 4
alex_vela10
317 Views, 3 Replies

Inventor Api 2023 Leader with parameter from subassembly

Hi everyone,

 

Recently, I was trying to create a leader note including a parameter by the Inventor API. I found out that the way of doing this is using the formatted text and it works fine for the bottom level of the assembly (single part). I can add a parameter (e.g. the description iproperty) for every individual part of one assembly/subassembly.

alex_vela10_0-1687849644447.png

 

However, when trying to add the parameter by formatted text for the subassembly source (one level above) it seems not to work and it adds the parameter of the bottom level (single part) of the leader associate occurrence.

alex_vela10_1-1687849717675.png

 

Is it possible to carry our what i am trying by the Inventor API?

 

Any help is well appreciated.

 

Thank you

3 REPLIES 3
Message 2 of 4
A.Acheson
in reply to: alex_vela10

Hi @alex_vela10 

One method is to attach a leader at the level you need and then read the formatted text. This will give the various documents required to created the text. 

 

At the code level the curve you pick will be at the parts level but you will need to get to the parent occurrence of the part occurrence. See API help here for parentoccurrence

 

Attach any code attempt that you have. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 4
alex_vela10
in reply to: A.Acheson

Thank you for the reply Alan

 

I have tried to get the formatted text from two different leaders created manually: one with the description iproperty of the bottom level member (single part) and the other with the description iproperty of the level above (the subassembly source). However, the formatted text that i get is the same in both cases so I am stuck at that point. How could I attach the leader to the desired level?

 

Thank for your help. it is really appreciated.

Message 4 of 4
A.Acheson
in reply to: alex_vela10

Hi @alex_vela10 

It looks like your using a newer version than 2020 so I cannot test your methods. Can you attach the sample of the formatted text your seeing. There may be a pattern than can be exposed. 

 

If your not worried about having formatted text you can just put the text of the iproperty directly into the leader.

Again if you can explain how much you want to automate and also attach the code your using that will help you get to your end goal. 

 

This is what I used for a quick test. 

Dim drawDoc As DrawingDocument = ThisDoc.Document
For Each LeadNte As LeaderNote In drawDoc.ActiveSheet.DrawingNotes.LeaderNotes
   Logger.Info(LeadNte.FormattedText)
Next

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan

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

Post to forums  

Autodesk Design & Make Report