How to get X-Y direction in view

 

Dear all,

I want to know what are direction of X-Y-Z in the view, user chosen.

If it is tilted to any of axis I want to know direction. Actually I want to draw lines parallel to these axis in the view.

Can anybody help me please.

 

thanks

Madhav

 

Posted by: madhav dhamale
Post date: 6/23/2009 9:17:18 PM

4 REPLIES

RE: How to get X-Y direction in view

If it is a view from a 3D model, i think you could use:

DrawingView.Modellink.range2D and DrawingView.Modellink.range3D

Range2D returns xmin,ymin, xmax, ymax of the 2D objects in your drawing view representing your 3D model. I guess that x is always horizontal and y always vertical.

Range3D returns xmin,ymin,zmin, xmax,ymax,zmax from your model corresponding to what it is represented in your drawing view.

I never tried this, but perhaps if it is a top view: zmin = zmax, front view: ymin=ymax, etc. I think you can guess the orientation easily if it is one of the standard views.

 

Also not tested, another way could be to activate the internal drawingview sheet as the active window (DrawingView.Sheet.Activate), then use the activewindow.windowtomodel conversion to find out the orientation

 

Posted by: Julian Guillo
Post date: 6/23/2009 9:54:50 PM

RE: How to get X-Y direction in view

Situation is: User is in view using 'drawinview' command. Now I want to know how X-Y and Z axis position with object in the view.

I used coordinatesystem2d, but could not understand. If anyone can attach code then it will be useful.

thanks in advance.

 

Posted by: madhav dhamale
Post date: 6/24/2009 9:35:54 PM

RE: How to get X-Y direction in view

OK,I did some "testing" instead of "guessing".You can use DrawingView.ModeltoView to check the orientation.See the example in VB6 (i think you are using this):

 Dim oSE As SolidEdgeFramework.ApplicationDim oDFT As SolidEdgeDraft.DraftDocumentDim oWin As SheetWindowDim oDWV As DrawingViewPrivate Sub Form_Load()Dim vx1 As Double, vy1 As DoubleDim vx2 As Double, vy2 As DoubleDim vx3 As Double, vy3 As DoubleDim vx4 As Double, vy4 As DoubleSet oSE = GetObject(, "solidedge.application")Set oDFT = oSE.ActiveDocumentSet oWin = oSE.ActiveWindowSet oDWV = oDFT.ActiveSheet.DrawingViews(1)oDWV.ModelToView 0, 0, 0, vx1, vy1 'OriginoDWV.ModelToView 1, 0, 0, vx2, vy2 'Point in XoDWV.ModelToView 0, 1, 0, vx3, vy3 'Point in YoDWV.ModelToView 0, 0, 1, vx4, vy4 'Point in Z'Studying the view coordinates returned you can see what 3d plane you are in.Debug.Print " X1= " & vx1 * 1000 & " Y1= " & vy1 * 1000Debug.Print " X2= " & vx2 * 1000 & " Y2= " & vy2 * 1000Debug.Print " X3= " & vx3 * 1000 & " Y3= " & vy3 * 1000Debug.Print " X4= " & vx4 * 1000 & " Y4= " & vy4 * 1000Debug.Print "-----------------------------"End Sub

 

Posted by: Julian Guillo
Post date: 6/25/2009 12:45:23 AM

RE: How to get X-Y direction in view

Hello Julian,

Thanks for code. I tried the code above.But when user is in the 'draftviewEdit' environment by 'DrawInView' command in popup.

How can I find which view is active/edited? How can I get object of view the user edited? There is no such property/method to find activeView or EditedView.

Can anybody help me?

 

Thanks,

Madhav

 

Posted by: madhav dhamale
Post date: 6/28/2009 8:06:27 PM