TheSwamp

CAD Forums => Vertically Challenged => Topic started by: MSTG007 on June 23, 2021, 03:00:30 PM

Title: Creating a Routine for Civil3D zoomtosectionview
Post by: MSTG007 on June 23, 2021, 03:00:30 PM
I have been messing around with trying to write a command with the C:zoomtosectionview in it. I am trying to figure how I can ask if I want to have two model tiles or single, then activate the zoomtosectionview command. The below will automatically activate the two tiles.

Code: [Select]
(defun C:Z2SL () ;Zoom to Sample Line with two model tiles
(setvar "cmdecho" 1)
(ai_tiledvp 2 "_V")
(command "zoomtosampleline")
(command "_AeccStationTrackerAll")
(setvar "cmdecho" 0)
(princ)
)

The other question I have, is if the two tiles are activated, it would know not to run that part of the code.

Again, thanks for the ideas and help.
Title: Re: Creating a Routine for Civil3D zoomtosectionview
Post by: Jeff_M on June 25, 2021, 10:33:13 AM
Code - Auto/Visual Lisp: [Select]
  1.       vps (vla-get-viewports doc)
  2.       count (vla-get-count vps)
  3.       )
  4. (if (= 1 count)
  5.   (progn
  6.     ;;only 1 viewport displayed
  7.     )
  8.   (progn
  9.     ;;more than 1 viewport displayed
  10.     )
  11.   )
  12.  
  13.  
Title: Re: Creating a Routine for Civil3D zoomtosectionview
Post by: MSTG007 on June 25, 2021, 01:17:58 PM
Thank you Jeff for the direction! Much Appreciated!