Werner77 Posted May 19, 2009 Posted May 19, 2009 It thought it would be very simple but... Goal: In AutoCAD 2008 (MAP), you have a 3D cloud and you want to navigate immediately to a certain point (target) in that cloud and give a good vizualization of the point in the cloud for 4 different views. Problem: I never see any point in the field of view of the 4 viewports Code: 'create a new viewport Set objViewPort = ThisDrawing.Viewports.Add("AllViewports") 'split objViewPort.Split acViewport4 For Each objCurrentViewport In ThisDrawing.Viewports If objCurrentViewport.LowerLeftCorner(0) = 0 Then If objCurrentViewport.LowerLeftCorner(1) = 0 Then 'this takes care of Front view dblViewDirection(0) = 0 dblViewDirection(1) = -1 dblViewDirection(2) = 0 objCurrentViewport.Direction = dblViewDirection objCurrentViewport.Target = targetPoint ThisDrawing.Application.ZoomExtents Else 'this takes care of Top view dblViewDirection(0) = 0 dblViewDirection(1) = 0 dblViewDirection(2) = 1 objCurrentViewport.Direction = dblViewDirection objCurrentViewport.Target = targetPoint ThisDrawing.Application.ZoomExtents End If End If If objCurrentViewport.LowerLeftCorner(0) = 0.5 Then If objCurrentViewport.LowerLeftCorner(1) = 0 Then 'this takes care of 3D view dblViewDirection(0) = 1 dblViewDirection(1) = -1 dblViewDirection(2) = 1 objCurrentViewport.Direction = dblViewDirection objCurrentViewport.Target = targetPoint ThisDrawing.Application.ZoomExtents Else 'this takes care of Side view dblViewDirection(0) = 1 dblViewDirection(1) = 0 dblViewDirection(2) = 0 objCurrentViewport.Direction = dblViewDirection objCurrentViewport.Target = targetPoint ThisDrawing.Application.ZoomExtents End If End If Next 'make the viewport active ThisDrawing.ActiveViewport = objViewPort I guess there is something wrong with the understanding of target, viewdir etc. Also the ZoomExtents is not working for each viewport. Can someone help, please?! Thank you! W Quote
Lee Mac Posted May 19, 2009 Posted May 19, 2009 This thread will probably get more response in the AutoLISP and VBA Customisation forum, I'm sure a moderator will kindly move it for you That said, don't duplicate this thread within another forum - as this complicates matters. Lee Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.