Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
dgreatice
in reply to: speterso

Hi,

 

I think addBaseView get error because, you active document are Part Document, not drawing document.

send it back drawing document  to active document.

 

your code:

PartDocument RouterPRTDoc = (PartDocument)m_InventorApp.Documents.Open(FullPartFileName.Replace(".ipt", "R.ipt"), true);

 

move this line after partdocument opened:

OutDWGDoc.Activate();

 

then:

DrawingView DWGBaseView = OutDWGSheet.DrawingViews.AddBaseView((_Document)RouterPRTDoc, tgView.CreatePoint2d(DWGView.Left, DWGView.Top), 1/1, ViewOrientationTypeEnum.kDefaultViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, "BaseViewForRouter", DWGView.Camera, NameValMap);

 

 

 

 

 

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014