generate automated drawings

generate automated drawings

Anonymous
Not applicable
723 Views
5 Replies
Message 1 of 6

generate automated drawings

Anonymous
Not applicable

Hello All,

 

Iam trying to generate automated  drawing for my assembly and iam trying to run the following code

 

Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

dim oDrawingDoc as DrawingDocument    
dim oPartDoc as Document
dim oSheet as sheet
dim oTG as TransientGeometry
dim oView1 as DrawingView
    
dwgQuery=msgbox("Would you like to Create a drawing for this glass?", vbyesno,"Drawing Selection")

if dwgQuery = vbYes then
    oPartDoc = ThisDoc.Document
    oDrawingDoc = ThisApplication.documents.Add(kDrawingDocumentObject, _
        "C:\Users\s.babu\Downloads\inventor2012\template.idw", True)
    oSheet = oDrawingDoc.Sheets.Item(1)
    oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(5#, 5#)
                oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc, _
        oPoint1, _
        1/10#, _
        kFrontViewOrientation, _
        kHiddenLineDrawingViewStyle)
end if

 

 

but when i run the code its asks me whether you want to generate the drawings, but when i say yes shows runtime argument error as show below

 

Error in rule: Rule0, in document: pin

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

 

when i ask for more info it shows the following error

 

System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Inventor.Documents.Add(DocumentTypeEnum DocumentType, String TemplateFileName, Boolean CreateVisible)
   at LmiRuleScript.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

 

someone please help me on this.

 

Thanks and Regards,

Shiva Babu

0 Likes
724 Views
5 Replies
Replies (5)
Message 2 of 6

skyngu
Collaborator
Collaborator

try to make scale = 1 or 0.1

see if it works.

Autodesk Inventor Professional 2019
0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks for your reply, but scale on what?

 

0 Likes
Message 4 of 6

Anonymous
Not applicable

can anyone please help me with this.

 

Thanks

0 Likes
Message 5 of 6

Anonymous
Not applicable

never mind i solved it by myself.

0 Likes
Message 6 of 6

Anonymous
Not applicable

How you resolve this ?

0 Likes