I'm trying to enter in "Draw in View" mode after convert the DrawingView to 2d, but I can't find any procedure to achieve that.
I would be very grateful if anybody can help me.
Thanks a lot
Dim application As SolidEdgeFramework.Application = Nothing Dim documents As SolidEdgeFramework.Documents = Nothing Dim draftDocument As SolidEdgeDraft.DraftDocument = Nothing Dim sheet As SolidEdgeDraft.Sheet = Nothing Dim objModelLink As SolidEdgeDraft.ModelLink = Nothing Dim objDrawingView As SolidEdgeDraft.DrawingView = Nothing application = SolidEdgeUtils.Connect(True) application.Visible = True application.Activate() documents = application.Documents draftDocument = CType(documents.open("c:\temp\MACRO_ESCALA_1X1.dft"), SolidEdgeDraft.DraftDocument) sheet = draftDocument.ActiveSheet objModelLink = draftDocument.ModelLinks.Add("c:\temp\0509156.par") objDrawingView = sheet.DrawingViews.AddPartView(objModelLink, SolidEdgeDraft.ViewOrientationConstants.igFrontView, 1, 0.1, 0.1, SolidEdgeDraft.PartDrawingViewTypeConstants.sePartDesignedView) objDrawingView.ModelMembers.Item(1).ShowHiddenEdges = False objDrawingView.ModelMembers.Item(1).ShowEdgesHiddenByOtherParts = False objDrawingView.Drop() 'Enter "Draw in View" mode here... objDrawingView.?????
Solved! Go to Solution.
I had plans to include exactly this feature in the Sheets API article that @Johnson_BigMatt mentioned but decided to save it for the DrawingViews API article which will be published shortly.
Meanwhile, try accessing the Sheet property of the drawing view. All drawing view geometry objects (e.g. DVxxx objects) are contained by the drawing view sheet. Then use the Activate method on this sheet to enter the 'Draw in View' mode.
To exit the mode, Activate the Sheet that the drawing view itself lies in, which is a Working Sheet in the Draft Document object.
I am writing this from memory but at least 12 hrs away from going back and confirming it on a computer with Solid Edge. Please give it a try and let me know if it works.
Oh, nice! I can see you declared the drawing view sheet variable as a SolidEdgeDraft.Sheet whereas it is mentioned simply as an Object in the API documentation.
Also knew you would want to exit the mode, so provided the extra tip to activate the working sheet - that's in the spirit of the Solid Edge Community!