Attributes on Border Definitions

Attributes on Border Definitions

Anonymous
Not applicable
470 Views
4 Replies
Message 1 of 5

Attributes on Border Definitions

Anonymous
Not applicable

I have been having trouble storing attributes on border definitions.  I have multiple borders which need to be used for different types of drawings.  I have developed a tool which will use the desired border pragmatically and it works as planned.  Currently the logic selects a border based on name, but since this can be edited by the user I need a more dependable way of retrieving a border.  I had thought attributes would be the answer, but I'm running into problems.  The attributes just won't stick.  I've tried to add them manually through the API and with the Attributes Helper tool released by Brian Ekins on the modthemachine blog.  See below for the code I'm using to add the attributes

 

    Dim oAttr As Inventor.Attribute Dim oAttrSet As AttributeSet Set oAttrSet = oBorderDef.AttributeSets.Add("TestAttributeSet", True) oAttrSet.Copy = True Set oAttr = oAttrSet.Add("TestAttribute", kIntegerType, 12345) Debug.Print oAttrSet.Parent.Parent.Name & " " & oAttrSet.Name & " " & oAttr.Name & " " & oAttr.Value

 It will print information leading me to believe that the attribute was added, but if I try to retrieve it either through the attributemanager or manually cycling through the border definitions no attributes exist.

 

Has anyone ran into this before?

0 Likes
471 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

Reposting with formatted code

 

Dim oAttrSet As AttributeSet
Set oAttrSet = oBorderDef.AttributeSets.Add("TestAttributeSet", True) 

oAttrSet.Copy = True

Dim oAttr As Inventor.Attribute
Set oAttr = oAttrSet.Add("TestAttribute", kIntegerType, 12345)


Debug.Print oAttrSet.Parent.Parent.Name & " " & _
     oAttrSet.Name & " " & _
     oAttr.Name & " " & _
     oAttr.Value

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

This appears to be a bug.  I am currently using Inventor 2013; Can someone from Autodesk confirm if this behaviour is still happening in 2014?

0 Likes
Message 4 of 5

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

I think it's the same type of issue as the one described here:

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Drawing-file-how-to-identify-a-TextBox...

 

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 5 of 5

Anonymous
Not applicable

I don't think that post directly relates since I'm not performing any edits to the sketch portion of the border definition.  The attribute is simply a way to reliably identify each border definition other than a name which can be edited through the UI.  That being said, I did go into edit mode of the border definition, add an attribute to the border definition, then exit the sketch using the attributes manager created by Brian Ekins, but the attributes didn't stick.  The results are the same whether the attribute is added in edit mode or not.

0 Likes