iLogic Create Drawing Automated Drawing (Help me)

iLogic Create Drawing Automated Drawing (Help me)

Anonymous
Not applicable
674 Views
1 Reply
Message 1 of 2

iLogic Create Drawing Automated Drawing (Help me)

Anonymous
Not applicable

Hi everyone,

 

I a new member. I'm trying to write a iLogic code what create drawing automated.

I searched through older topic but its too complex for what I'm finding and learning. 

The code what I'm trying to write is:

 When in .ipt's environment I have a part then I create a messbox with YesNo button its will trans me to .idw's environment and place a baseview.

Hope you guys can help me

 

Thanks you

0 Likes
Accepted solutions (1)
675 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Automating drawings is a fairly advanced task and usually needs to be customized to a company's and/or or user's specific needs/wants.  Because of this, there is not a universal, super simple solution available that fits everyone's needs, without any changes.

 

Did you know that, within an assembly or part document, you can select the top node in your Model Browser tree, then right click, and choose "Create Drawing View" (from that right-click menu), then it will pop-up a dialog asking you to choose which drawing document template you want to use, then when you select one, it will be ready to click/place the first base view in a new drawing for you, without having to use any code?

 

Here is something fairly basic that will do something similar to what the above process does.

- You need to change the path and/or file name of the drawing template file I am specifying within the code, before trying to run it.

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kPartDocumentObject And _
	ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kPartDocumentObject Then
	MsgBox("This rule must be ran while a Part or Assembly is active. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If

'Drawing Template to use - path and file name
Dim oTPath As String = ThisApplication.FileOptions.TemplatesPath
Dim oTName As String = "A-Size Standard Drawing.idw"
Dim oTemplate As String = oTPath & "\" & oTName

Dim oDDoc As DrawingDocument = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, oTemplate, True)
ThisApplication.CommandManager.ControlDefinitions.Item("DrawingBaseViewCmd").Execute

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you have time, please... Vote For My IDEAS 💡or you can Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)