Jump to content

Perspective view of the object and switch to plan view( centred to the object at distance viewed in perspective view)


Recommended Posts

Posted (edited)

Hi

Strange request here.

When i look at specific object in perspective view, would it be possible  to switch to plan view, but centred on object of interest at the same distance as viewed in perspective view? Currently i just type in ''plan'' , but it gives overall view with all detail in drawing.

I am not sure if there is a  settings/command in autocad or i would need a lisp command to do this. Any ideas, please?

 

 

 

Perspective view of the object.JPG

Plan view of the object centred.JPG

Edited by pyou
  • pyou changed the title to Perspective view of the object and switch to plan view( centred to the object at distance viewed in perspective view)
Posted

Not sure exactly as I don't play with views except in layouts as plan production, but it sounds like what you want as a sequence.

 

Plan Zoom Center pt scale

 

The scale will be a number you may find that one number gives a reasonable zoomed in view. 

The pt will be a point selected in your isometric view. (setq pt (getpoint "\nPick a point ")) you could make a little defun that gets you the point, so run that 1st. 

 

(defun c:pt ( / )
(setq pt (getpoint "\nPick point "))
)

 

So the sequence becomes.

Dbl click isometric view

pt

dbl click plan view

plan z c pt 1000

Posted

Check out this 

 

Posted (edited)

Something like this, but it's not working perfect, Any suggestions how to improve?

Seems not to work properly with 3dpolylines, lines and polylines. Is there a way to click on polyline and that point to become a centre of object or something similar alternative? On other objects it seems to work as i want.

 

Thank you

 

Lisp:

(defun c:ZoomToPlanView (/ obj obj_center)
  ;; Prompt the user to select an object
  (setq obj (car (entsel "\nSelect an object to view in plan view: ")))
  
  ;; Check if the user selected an object
  (if obj
    (progn
      ;; Get the object's center point
      (setq obj_center (cdr (assoc 10 (entget obj))))
      
      ;; Switch to plan view
      (command "_.plan" "")
      
      ;; Zoom into the object
      (command "_.zoom" "_c" obj_center 1.0)
      
      (princ "\nObject displayed in plan view and zoomed.")
    )
    (princ "\nNo object selected.")
  )
  (princ)
)

 

 

Edited by pyou
Posted

When using zoom c, I never found it to use 1.0, I think you need to do manually and see what Zoom C returns in your zoomed in/out view I doubt it will be 1.0.

 

Current dwg zoom C = 55.797 not 1.0 value changes, zoom e,  Zoom c = 163.78

Posted

still not found solution for 3dpolylines,lines and polylines. any help,please?

Posted

And if you use the command DVIEW?

((lambda ( / e_sel e pt_sel)
  (princ "\nSelect an object.")
  (cond
    ((setq e_sel (entsel))
      (setq e (car e_sel) pt_sel (osnap (cadr e_sel) "_near"))
      (command "_.dview"
        e ""
        "_points" "_none"
        (list (car pt_sel) (cadr pt_sel) 0.0)
        "_none"
        (list  (car pt_sel) (cadr pt_sel) 1.0)
        ""
      )
    )
    (T (princ "\nNothing selected."))
  )
  (prin1)
))

 

  • Thanks 1
Posted (edited)
On 07/11/2024 at 00:50, Tsuky said:

And if you use the command DVIEW?

((lambda ( / e_sel e pt_sel)
  (princ "\nSelect an object.")
  (cond
    ((setq e_sel (entsel))
      (setq e (car e_sel) pt_sel (osnap (cadr e_sel) "_near"))
      (command "_.dview"
        e ""
        "_points" "_none"
        (list (car pt_sel) (cadr pt_sel) 0.0)
        "_none"
        (list  (car pt_sel) (cadr pt_sel) 1.0)
        ""
      )
    )
    (T (princ "\nNothing selected."))
  )
  (prin1)
))

 

Thank you Tsuky! it seems sometimes when i click on MText or Text its just isolate selected text and getting error

''object snap not allowed here.
Requires direction and magnitude angles separated by a comma.
; error: Function cancelled.  

 

Would it be possible to incorporate _pnod  to pick a pointcloud point and have same principal what dview does?

Edited by pyou
Posted
On 11/8/2024 at 8:40 PM, pyou said:

Thank you Tsuky! it seems sometimes when i click on MText or Text its just isolate selected text and getting error

''object snap not allowed here.
Requires direction and magnitude angles separated by a comma.
; error: Function cancelled.  

 

Would it be possible to incorporate _pnod  to pick a pointcloud point and have same principal what dview does?

You say before:

Quote

still not found solution for 3dpolylines,lines and polylines. any help,please?

I have specified the code for this task.

But you can add for exemple at line 5:

((lambda ( / e_sel e pt_sel)
  (princ "\nSelect an object.")
  (cond
    ((setq e_sel (entsel))
      (setq e (car e_sel) pt_sel (osnap (cadr e_sel) "_near,_ins,_nod"))
      (command "_.dview"
        e ""
        "_points" "_none"
        (list (car pt_sel) (cadr pt_sel) 0.0)
        "_none"
        (list  (car pt_sel) (cadr pt_sel) 1.0)
        ""
      )
      (sssetfirst nil (ssadd (car e_sel)))
    )
    (T (princ "\nNothing selected."))
  )
  (prin1)
))

 

For pnod I can't incorporate this, but without control of the return of "pnod" you can try this

((lambda ( / pt_sel)
  (command "_.ID" "_pnod" pause)
  (setq pt_sel (getvar "LASTPOINT"))
  (command "_.dview"
    ""
    "_points" "_none"
    (list (car pt_sel) (cadr pt_sel) 0.0)
    "_none"
    (list  (car pt_sel) (cadr pt_sel) 1.0)
    ""
  )
  (prin1)
))

 

  • Thanks 1
Posted
5 hours ago, Tsuky said:

You say before:

I have specified the code for this task.

But you can add for exemple at line 5:

((lambda ( / e_sel e pt_sel)
  (princ "\nSelect an object.")
  (cond
    ((setq e_sel (entsel))
      (setq e (car e_sel) pt_sel (osnap (cadr e_sel) "_near,_ins,_nod"))
      (command "_.dview"
        e ""
        "_points" "_none"
        (list (car pt_sel) (cadr pt_sel) 0.0)
        "_none"
        (list  (car pt_sel) (cadr pt_sel) 1.0)
        ""
      )
      (sssetfirst nil (ssadd (car e_sel)))
    )
    (T (princ "\nNothing selected."))
  )
  (prin1)
))

 

For pnod I can't incorporate this, but without control of the return of "pnod" you can try this

((lambda ( / pt_sel)
  (command "_.ID" "_pnod" pause)
  (setq pt_sel (getvar "LASTPOINT"))
  (command "_.dview"
    ""
    "_points" "_none"
    (list (car pt_sel) (cadr pt_sel) 0.0)
    "_none"
    (list  (car pt_sel) (cadr pt_sel) 1.0)
    ""
  )
  (prin1)
))

 

Thank you Tsuky, Works excellent.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...