API Start a drawing clean, without running ilogic or prompted entries

API Start a drawing clean, without running ilogic or prompted entries

DWhiteley
Advisor Advisor
499 Views
2 Replies
Message 1 of 3

API Start a drawing clean, without running ilogic or prompted entries

DWhiteley
Advisor
Advisor

Hi,

 

I want to start a new drawing clean, using:

 

 oDrawdoc = m_inventorApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, oTemplate, True)

 

But most importantly, for any iLogic routine to NOT run & any prompted entries NOT to come up.

Is this possible?

 

Thanks in advance.

 

Dave

Envisage UK Ltd

0 Likes
Accepted solutions (1)
500 Views
2 Replies
Replies (2)
Message 2 of 3

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi Whiteley,

 

It is possible to create clean drawing on creating addin.

 

In StandardAddInServer.vb file, there is a method/function called as Activate(....). Inside this, a DrawingDocument can be initialized as shown in the following.

 

Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate

m_inventorApplication = addInSiteObject.Application

Dim oDrawingDoc As DrawingDocument
oDrawingDoc = m_inventorApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, oTemplate, True)
End Sub

After starting inventor, a drawing document will be opened without any prompt.

 

Please feel free to contact if there is any doubt.

 

If solves your question, Click on "Accept as solution" / Give a Kudo.

 

Thanks and regards,

 


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 3

Owner2229
Advisor
Advisor
Accepted solution

Try this:

 

m_inventorApplication.SilentOperation = True
Try
'<Your code here>
Catch
End Try m_inventorApplication.SilentOperation = False
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes