Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

generate automated drawings

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
561 Views, 5 Replies

generate automated drawings

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

5 REPLIES 5
Message 2 of 6
skyngu
in reply to: Anonymous

try to make scale = 1 or 0.1

see if it works.

Autodesk Inventor Professional 2019
Message 3 of 6
Anonymous
in reply to: skyngu

Thanks for your reply, but scale on what?

 

Message 4 of 6
Anonymous
in reply to: Anonymous

can anyone please help me with this.

 

Thanks

Message 5 of 6
Anonymous
in reply to: Anonymous

never mind i solved it by myself.

Message 6 of 6
Anonymous
in reply to: Anonymous

How you resolve this ?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report