Results 1 to 9 of 9

Thread: Civil 3D - Call Point Number command from Zoom Center

  1. #1
    I could stop if I wanted to
    Join Date
    2004-11
    Location
    Somewhere close to hell
    Posts
    228
    Login to Give a bone
    0

    Question Civil 3D - Call Point Number command from Zoom Center

    In civil3d the user has the ability to select a given point and zoom to it, is there a way to call a transparent command Ex: 'pn "Point Number" from the zoom center command?

    Code:
    (defun c:zp ()
    (setq pt1 (command "'pn"))
    (command "zoom" "c" pt1)
    (princ)
    )

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,095
    Login to Give a bone
    0

    Default Re: Civil 3D - Call Point Number command from Zoom Center

    Quote Originally Posted by rad.77676
    In civil3d the user has the ability to select a given point and zoom to it, is there a way to call a transparent command Ex: 'pn "Point Number" from the zoom center command?

    Code:
    (defun c:zp ()
    (setq pt1 (command "'pn"))
    (command "zoom" "c" pt1)
    (princ)
    )
    Have you tried the Zoom Object command? If you can get the entity name from the "pn" command, the Zoom with the Object option should provide you what you want.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    I could stop if I wanted to
    Join Date
    2004-11
    Location
    Somewhere close to hell
    Posts
    228
    Login to Give a bone
    0

    Default Re: Civil 3D - Call Point Number command from Zoom Center

    The pn command prompts user for point number, it only returns what you give it.
    The issue is how to call the transparent 'PN command during to zoom command?

    Any ideas?
    Last edited by rad.77676; 2007-02-06 at 10:25 PM.

  4. #4
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277
    Login to Give a bone
    0

    Default Re: Civil 3D - Call Point Number command from Zoom Center

    Hi rad,
    I'm not yet understanding,what are you looking for.
    but here my code to check as you want
    Code:
    (defun c:zp (/ ss sse etyp sp mag)
      (if
        (setq ss (car (entsel "\nSelect an object point")))
        (progn
          (setq sse (entget ss))
          (setq etyp (cdr (assoc 0 sse)))
          (if
    	(= etyp "POINT")
    	(progn
    	  (setq sp (cdr (assoc 10 sse)))
    	  (setq mag 100)
    	  (command "_zoom" "c" sp mag "")
    	  )                                ; progn
    	(alert "\nThis object is not Point")
    	)                                  ; if
          )                                    ; progn
        (alert "\nInvalid selected object,please try again")
        )                                      ; if
      (princ)
      )
    Quote Originally Posted by rad.77676
    In civil3d the user has the ability to select a given point and zoom to it, is there a way to call a transparent command Ex: 'pn "Point Number" from the zoom center command?

    Code:
    (defun c:zp ()
    (setq pt1 (command "'pn"))
    (command "zoom" "c" pt1)
    (princ)
    )

  5. #5
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: Civil 3D - Call Point Number command from Zoom Center

    Hi rad,
    Here's a lisp that does what you need. The ActiveX ZoomCenter method allows for a magnification value which I have hardcoded to be 10x the current value.
    Code:
    (defun c:zoom2pt (/ aeccdoc appstr point points pt pt# vrsn)
      (setq vrsn (vlax-product-key))
      (cond ((vl-string-search "R16.2" vrsn)(setq appstr "3.0"))
    	((vl-string-search "R17.0" vrsn)(setq appstr "4.0"))
    	(t (alert "This version of C3D not supported!"))
    	)
      (if (and appstr
    	   (or *acad*
    	       (setq *acad* (vlax-get-acad-object))
    	       )
    	   (or *AeccApp*
    	       (setq *AeccApp* (vla-getinterfaceobject *acad*
    				 (strcat "AeccXUiLand.AeccApplication." appstr)))
    	       )
    	   (setq aeccdoc (vlax-get *AeccApp* 'ActiveDocument))
    	   (setq pt# (getint "\nZoom to point #?: "))
    	   (setq points (vlax-get aeccdoc 'points))
    	   (not (vl-catch-all-error-p
    		  (vl-catch-all-apply
    		    '(lambda ()
    		       (setq point (vlax-invoke points 'find pt#))
    		       )
    		    )
    		  )
    		)
    	   )
        (progn
          (setq pt (vlax-get point 'location))
          (setq vsize (getvar "viewsize"))
          (vlax-invoke *acad* 'zoomcenter pt (/ vsize 10.0))
          (vlax-release-object points)
          (vlax-release-object aeccdoc)
          )
        )
      (princ)
      )
    HTH,
    Jeff

  6. #6
    I could stop if I wanted to
    Join Date
    2004-11
    Location
    Somewhere close to hell
    Posts
    228
    Login to Give a bone
    0

    Talking Re: Civil 3D - Call Point Number command from Zoom Center

    Works like a charm!
    Thanks Jeff

  7. #7
    I could stop if I wanted to
    Join Date
    2004-11
    Location
    Somewhere close to hell
    Posts
    228
    Login to Give a bone
    0

    Question Re: Civil 3D - Call Point Number command from Zoom Center

    Jeff,
    Rather than basing the zoom factor on the viewsize is there a way to make the zoom factor the same every time?
    Rob

  8. #8
    I could stop if I wanted to
    Join Date
    2004-11
    Location
    Somewhere close to hell
    Posts
    228
    Login to Give a bone
    0

    Default Re: Civil 3D - Call Point Number command from Zoom Center

    Jeff,
    I just removed (/ vsize 10.0) and replaced with vsize so the view remains constant from point to point.
    Thanks for your help!
    Rob

  9. #9
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,095
    Login to Give a bone
    0

    Default Re: Civil 3D - Call Point Number command from Zoom Center

    Quote Originally Posted by rad.77676
    Jeff,
    Rather than basing the zoom factor on the viewsize is there a way to make the zoom factor the same every time?
    Rob
    Zoom to the size you want. Extract the "VIEWSIZE" system variable. Place that size in place of the formula (/ vsize 10.0) in the following line from Jeff's code.
    Code:
    (vlax-invoke *acad* 'zoomcenter pt (/ vsize 10.0))
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Similar Threads

  1. Work Request Management (call center?)
    By Wanderer in forum Facilities Management In Practice
    Replies: 1
    Last Post: 2015-07-07, 06:03 PM
  2. 2014: Control how far Zoom command will zoom out?
    By mbrandt5 in forum AutoCAD General
    Replies: 13
    Last Post: 2015-05-21, 05:42 PM
  3. Call out sheet number on View Lable Title
    By joforman in forum AutoCAD Sheet Set Manager
    Replies: 0
    Last Post: 2012-01-11, 06:10 PM
  4. Replies: 10
    Last Post: 2007-03-23, 01:50 AM
  5. Performance issues - Slow Zoom when using the Zoom command
    By gsmith.29521 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-11-01, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •