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: 

Global Form to create and edit Parameters in any assembly

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
b.tarek
141 Views, 3 Replies

Global Form to create and edit Parameters in any assembly

Hi, I want to use a global form for any assembly opened at the moment that'll take the parameters inserted in it and create custom properties based on them.

 

For ex. I press iTrigger or open the global form directly, it opens with empty areas/placeholders to type in my parameters like work order number and once I press apply or done (or a rule button) it saves the values I've entered as custom iProperties into all the components in the assembly.

 

Tags (2)
3 REPLIES 3
Message 2 of 4
A.Acheson
in reply to: b.tarek

Hi @b.tarek 

Can you attach your sample code you have worked on? You can do this without code if you save your custom iproperties in the assembly and part template. Then when you open the form on a new document the iprop is allready there and you just input a value. 

 

Here is the rule you need to add to the global form.

Create the rule and add rule button the the form. Thus when applied will take the iproperty specified and send to all iproperties in referenced documents. If your documents don't have the custom iproperty then you will need to add this which is an extra step. 

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

Thank you so much Alan, didn't think of using the custom iProperties in the template file.

 

I have written the rule for another assembly but was just having problems applying it to all the other assemblies created, this solves it thanks again.

Message 4 of 4
A.Acheson
in reply to: b.tarek

Hi @b.tarek 

Great to hear, if it has solved it mark the post as solved so others know what has worked. Or indeed post your finished code and steps required to make it work..

Here is the API sample for adding iproperties written in VBA. Once you have the custom property sets...

 

    ' Get the active document.
    Dim invDoc As Document = ThisApplication.ActiveDocument
    
    ' Get the user defined (custom) property set.
    Dim invCustomPropertySet As PropertySet = invDoc.PropertySets.Item("Inventor User Defined Properties")
      
    ' Create the properties.
    Dim invProperty As [Property] = 
Try
invProperty = invCustomPropertySet.Item("Test")
invProperty.Value = "Test" Catch
invProperty = invCustomPropertySet.Add("Test", "Test Value")
End Try

 

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