Flat pattern in macro doesnt work

Flat pattern in macro doesnt work

Anonymous
Not applicable
489 Views
3 Replies
Message 1 of 4

Flat pattern in macro doesnt work

Anonymous
Not applicable

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

0 Likes
Accepted solutions (2)
490 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Oh Im sorry I have already figured it out. The problem was in chzech language. 


0 Likes
Message 3 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@Anonymous,

 

It is nice to hear that you found a solution for question.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 4 of 4

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Could you please mark it as solved then, for administrative reasons.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes