- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have a problem with the drawing properties updating after modifying a part.
When i create a copy design of a sheet metal part and copy the drawing with it, then modify the part, the flat pattern dimensions are not writen to the drawing properties.
in short i want to write all custom properties that are in my part to my drawing file's custom properties.
i know there are different solutions for this and there is an answer on the autodesk knowledge page, but i have a problem with my code that i thought would be simple.
first i will show the code and then explain the problem
Dim Drawdoc As Document = ThisApplication.ActiveDocument
If Drawdoc.DocumentType = kDrawingDocumentObject Then
Dim Modeldoc As Document = Drawdoc.ReferencedDocuments.Item(1)
Dim Modelname As String = Modeldoc.FullFileName
Dim ParaNom As Integer = Modeldoc.PropertySets("Inventor User Defined Properties").Count
For a = 1 To ParaNom
Dim ModelDesc As Object = Modeldoc.PropertySets("Inventor User Defined Properties").Item(a)
Dim Propname As String = ModelDesc.displayname
Dim DrawDesc As Object = Drawdoc.PropertySets("Inventor User Defined Properties").Item(Propname)
MsgBox(DrawDesc.displayname)
DrawDesc.Value=ModelDesc.Expression
Next
End If
what i think i'm doing is taking the name of a property in the part, then using that name to call the same property in the drawing.
in this case the Propname is always a string. messageboxes work when i fill in propname.
When i call the drawing property with an integer (a) it also works.
I can not use the same counter because item 1 in the part does not have to be item 1 in the drawing.
Referenced file can always be 1 because this only happens for part drawings, i can build in a check for this.
Properties that are in de part will always be also in the drawing file, because these are made when the drawing is created. (this company has mulitple codes running in the background)
Does anyone know why i cannot use this way of calling a property?
kind regards,
Geert
Solved! Go to Solution.