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.
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.
Is it possible to carry our what i am trying by the Inventor API?
Any help is well appreciated.
Thank you
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.
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.
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
Can't find what you're looking for? Ask the community or share your knowledge.