Найти в Дзене
G-Pr.info

Разработка почтового ящика из листового металла в Autodesk inventor.

Хочется поделится процессом разработки почтового ящика в Autodesk inventor и способами автоматического формирования чертежей, разверток и спецификаций.

Вот такой вот почтовый ящик получился.

Почтовый ящик
Почтовый ящик

После создания готового изделия, следующим этапом необходимо получить развертки, для вырезки деталей на ЧПУ. Ниже код iLogic. Управление-добавить правило. И копировать код ниже.

Dim oDoc As AssemblyDocument

oDoc = ThisApplication.ActiveDocument

'If document is not assembly, alert user and exit rule

If oDoc.DocumentType <> kAssemblyDocumentObject Then

MessageBox.Show("This rule must be run from an Assembly.", "iLogic")

Exit Sub

End If

'get user input

RUsure = MessageBox.Show ( _

"This will create a DXF file for all sheet metal components." _

& vbLf & " " _

& vbLf & "Are you sure you want to create a DXF for all of the sheet metal components in this assembly?" _

& vbLf & "This could take a while.", "iLogic - SaveAllDXF ",MessageBoxButtons.YesNo)

If RUsure = vbNo Then

Return

Else

End If

'- - - - - - - - - - - - -Establish DXF Save Path - - - - - - - - - - - -

oPath = ("C:") 'Must include final backslash

'- - - - - - - - - - - - -Components - - - - - - - - - - - -

Dim oRefDocs As DocumentsEnumerator

Dim oRefDoc As Document

oRefDocs = oDoc.AllReferencedDocuments

'Iterate through referenced docs

For Each oRefDoc In oRefDocs

Dim oCurFile As Document 'current file

Try

oCurFile = ThisApplication.Documents.Open(oRefDoc.FullFileName, False)

'False == open invisible, True == open visible. invisible is much faster.

Catch

GoTo NextIteration

End Try

If oCurFile.DocumentSubType.DocumentSubTypeID <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then

'document is not sheet metal.

oCurFile.Close(True) 'True == skip save

Else

oCurFileName = oCurFile.FullFileName

'get the postion of the last backslash in the path

FNamePos = InStrRev(oCurFileName, "\", -1)

'get the file name with the file extension

FName = Right(oCurFileName, Len(oCurFileName) - FNamePos)

'get the file name (without extension)

FName = Left(FName, Len(FName) - 4)

'set dxf filename

DxfName = oPath & FName & ".dxf"

Dim oSMCD As SheetMetalComponentDefinition = oCurFile.ComponentDefinition

If Not oSMCD.HasFlatPattern Then 'If it doesn't have a flat pattern, create one (unfold the model)

oSMCD.Unfold()

oSMCD.FlatPattern.ExitEdit()

End If

'set dxf options

Dim sOut As String = "FLAT PATTERN DXF?AcadVersion=2010" _

+ "&OuterProfileLayer=IV_INTERIOR_PROFILES" _

+ "&SimplifySplines=True" _

+ "&BendLayerColor=255;255;0"

Try

oSMCD.DataIO.WriteDataToFile(sOut, DxfName) 'save the dxf

Catch

End Try

oCurFile.Close(True)

End If

NextIteration:

Next

Пример полученной развертки.
Пример полученной развертки.

Далее необходимо, обозначить радиус и угол гибки, файл-создать чертеж dwg.

В самом чертеже расставить виды разверток деталей и расставить метки элементов на сгибах.

-3

И создать лист со спецификацией, формируется автоматически пояснение-спецификации.

Спецификация
Спецификация

Готово, можно отдавать в производство.