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: 

Formatted text linked user parameter to drawing

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
A.Acheson
766 Views, 3 Replies

Formatted text linked user parameter to drawing

 

In a drawing is it possible to retrieve all the user parameters of select sub assemblies into a formatted text linked parameter in general text, general leader etc through ilogic. This functionality is already there but useable by manually placing in the UI.See below picture.

 

This method is reasonably slow as you wait for dialogue boxes to open, grab the next leader , and may not have the flexibility to pick drawing views or other predefined comments in for labelling .


The code below would be the start to it as the assy path is a variable in this case linked to the view but could be linked to subassembly occurrence. I can bring the occurrences paths, occurrences  in as separate array list box but how to get the parameter name, then the multi value parameter list. Is there such a thing as a multi column list box?

EC10FA01-7470-4EDB-98D8-7E0DF24BAE0B.png


https://forums.autodesk.com/t5/inventor-customization/general-notes-formatted-text-linked-parameter-...

Option Explicit

Sub AddGeneralNotes()
    Dim oDoc As DrawingDocument: Set oDoc = ThisApplication.ActiveDocument
    Dim oSheet As Sheet: Set oSheet = oDoc.ActiveSheet
    Dim oGNs As GeneralNotes: Set oGNs = oSheet.DrawingNotes.GeneralNotes
    Dim oTG As TransientGeometry: Set oTG = ThisApplication.TransientGeometry
    
    Dim oNoteB As GeneralNote
    Set oNoteB = oGNs.AddFitted(oTG.CreatePoint2d(5, 18), "sText")
    
    Dim assyPath As String
    assyPath = oSheet.DrawingViews(1).ReferencedDocumentDescriptor.FullDocumentName
    
    oNoteB.FormattedText = "TEST <Parameter Resolved='True' ComponentIdentifier='" & assyPath & "' Name='TestParam' Precision='2'></Parameter>"
End Sub

 

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

Are you attempting to recreate similar functionality to the dialog, so that you still have a prompt to select either the main assembly, or one of its components from a list, then another prompt to select one of its user parameters from a list, then have it insert its linked value into the note?  Do you also want other InputBox type user interaction before or after those inserted items?  If so, it might not actually be faster or more convenient than just using the dialog.  Or do you want something completely automated that creates a single new note that is to contain a list of all user parameters from main assembly and all user parameters from each of its components?  I'm just trying to better understand exactly what you are trying to accomplish, and perhaps its purpose/intent.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4
A.Acheson
in reply to: WCrihfield

@WCrihfield 

Thanks for the response. The idea :light_bulb: is to have a child to child relationship linked at child level which is a base view  in separate files.  The information placed into a leader.

Basically making a map but in tiny little pieces. A Process flow diagram is the map with all the pieces intact.

So the functionality of grabbing the user parameter is there at the moment but the required linked information to the next child isn’t.

 

This is linked to this question. 

https://forums.autodesk.com/t5/inventor-customization/piping-isomtrics-creating-tags-or-reference-to...

 

Idea would be to have a similar functionality of the dialogue box but with autodetect of the child (already possible with part number balloon) and then have an option to select from a list of user parameters connected with that child or other children to populate the next connection details. 

 

 

 

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

I realized afterwards that because the sub assembly was not visible in the drawing, no formatted text user parameter could be added and be linked. It could only be added as basic text. 

 

Passing the parameter to a drawing parameter/iproperty then placing it on the drawing is the only way forward I can see. 

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  

Technology Administrators


Autodesk Design & Make Report