Hi,
Im trying to find out the parameters that stands for the view scale and format in a idw. I cannot find the parameter for the view scale. Anyone any idea?
I use Visual Basic. Code for get mass is easy ...
mass = oDoc1.ComponentDefinition.MassProperties.Mass()
What about view scale if idw and format?
Thanks,
Gregor
Hi,
I use this:
SyntaxEditor Code Snippet
'ViewScale Dim odrawdoc As DrawingDocument = ThisDoc.Document customPropertySet = odrawdoc.PropertySets.Item("Inventor User Defined Properties") For i = 1 To odrawdoc.Sheets.Count Try prop = customPropertySet.Item("Scale" + Str(i)) Catch customPropertySet.Add("", "Scale" + Str(i)) End Try Try iProperties.Value("Custom", "Scale" + Str(i)) = odrawdoc.sheets.item(i).DrawingViews.Item(1).ScaleString Catch End Try Next i
Mr. Robert, thanks for reply, but I had already tried that, and not working.
But I found solution,
For Each oDrgView In oDrgViews
Dim scl As Double
scl = oDrgView.Scale
Dim oRefFileDesc As ReferencedFileDescriptor
oRefFileDesc = oDrgView.ReferencedFile
If (TypeOf oRefFileDesc.ReferencedDocument Is PartDocument) Then
Dim oPartDoc As PartDocument
oPartDoc = oRefFileDesc.ReferencedDocument
ElseIf (TypeOf oRefFileDesc.ReferencedDocument Is AssemblyDocument) Then
Dim oAsmDoc As AssemblyDocument
oAsmDoc = oRefFileDesc.ReferencedDocument
Else
Dim oPresDoc As PresentationDocument
oPresDoc = oRefFileDesc.ReferencedDocument
End If
...
that works,
Now I don't know how to get FORMAT from idw.
Hi gregor.rihtar,
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I'll ask the forum Admin to move this topic the correct forum.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
What "format" are you talking about/ wanting to get from the drawing?
Thanks for reply.
I solved that problem too.
I will share, maybe someone need it too.
merilo = "1 : " + (1 / scl).ToString
sheet_size = oSheet.Size.ToString
sheet_size ... format (A4, A3 ...)
merilo (1:5 ...)
Can't find what you're looking for? Ask the community or share your knowledge.