Creating File with iLogic (dwg, idw)

Creating File with iLogic (dwg, idw)

MarcinStJasinski
Contributor Contributor
1,080 Views
1 Reply
Message 1 of 2

Creating File with iLogic (dwg, idw)

MarcinStJasinski
Contributor
Contributor

Hi everyone.

Is there any way to create new blank DWG file using iLogic?

 

I want to have rule which checks if part file has its sketch file (DWG or IDW) and if there is no such a file rule must creates new file.

 

Sorry for my English.

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

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

With this rule, activated in a part or assembly file, you will create a drawing file and place the part in the drawing.

Dim  oDoc As Document   ' Part Document or Assembly Document
oDoc = ThisDoc.Document

'Create a drawing from the drawing template
Dim templateFile As String
templateFile = "w:\03 FORMATS & TEMPLATES\02 Inventor\Templates\Document Template.idw"  '''Place the path of your template idw

Dim oDrawingDoc As DrawingDocument = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject,templateFile,True)

oDrawingDoc.Activate()
Dim oSheet As Sheet = oDrawingDoc.Sheets.Item(1)

Dim oPoint1 As Point2d
oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(5, 5)

Dim oView As DrawingView
oView = oSheet.DrawingViews.AddBaseView(oDoc,oPoint1, 1, ViewOrientationTypeEnum.kBottomViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle)
oDoc.ReleaseReference
 
Call oDoc.Close(True)

 I hope it will help you extract the part of the code you need.
regards!!!


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn