Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

How to enter in "Draw in View" mode

Experimenter
Experimenter

Hi,

 

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

 

ScreenHunter 187.png

 

My code:

 

 

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.?????

 

4 REPLIES

Re: How to enter in "Draw in View" mode

Gears Phenom Gears Phenom
Gears Phenom

@Tiago_Bortolini,

 

@Tushar  has written a one-stop shop blog for you on just this topic

 

 

https://community.plm.automation.siemens.com/t5/Solid-Edge-Blog/All-about-Sheets-using-the-Solid-Edg...


Matt Johnson
Solid Edge Certified Professional (ST7 & ST8)
Solid Edge ST9 (SEEC) - Production
SE2019 Pre-Production Testing
NX11 (Tc Integration) Pre-Production Testing
Teamcenter 10.1.7

Re: How to enter in "Draw in View" mode

Gears Honored Contributor Gears Honored Contributor
Gears Honored Contributor

Hi @Tiago_Bortolini

 

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.

 

Regards,

~Tushar Suradkar

www.SurfAndCode.IN

www.CADVertex.com

 

Re: How to enter in "Draw in View" mode

Experimenter
Experimenter

@Johnson_BigMatt

@Tushar

 

Thanks a lot!!!! It worked perfectly.

 

'Draw in View mode
Dim seViewSheet As SolidEdgeDraft.Sheet = objDrawingView.Sheet
seViewSheet.Activate()

'Go back to the original sheet
sheet.Activate()

Re: How to enter in "Draw in View" mode

Gears Honored Contributor Gears Honored Contributor
Gears Honored Contributor

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!

 

Regards,