
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
please I am looking for help.
I've got this macro below and everything works exept of flat pattern dimensions. Do you know where the problem is?
Thak You for your help.
Vito
Sub Main ()
Dim oDoc As Inventor.Document
Dim oPartDoc As Inventor.PartDocument
Dim oCompDef As Inventor.ComponentDefinition
Dim oFlatExtent As Boolean = False
Try
oDoc = ThisDoc.Document
If oDoc.DocumentType = kPartDocumentObject Then
oPartDoc = oDoc
If oPartDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
oCompDef = oPartDoc.ComponentDefinition
If oCompDef.HasFlatPattern = True Then
oFlatExtent = True
End If
End If
End If
If oFlatExtent = False Then
L = Round(Measure.ExtentsLength,1)
B = Round(Measure.ExtentsWidth, 1)
H = Round(Measure.ExtentsHeight, 1)
iProperties.Value("Custom", "Rozmer") = L & "x" & B & "x" & H
Else
L = Round(SheetMetal.FlatExtentsLength, 1)
B = Round(SheetMetal.FlatExtentsWidth, 1)
H = Parameter("Tloušťka")
iProperties.Value("Custom", "Rozmer") = H & "-" & L & "x" & B
iProperties.Value("Custom", "Délka rozvinu") = "" & L
iProperties.Value("Custom", "Šířka rozvinu") = "" & B
iProperties.Value("Custom", "Tloušťka plechu") = "" & H
End If
Catch ex As Exception
iProperties.Value("Custom", "Rozmer") = "iLogicRule Error"
End Try
End Sub
Solved! Go to Solution.