Author Topic: Creating a Routine for Civil3D zoomtosectionview  (Read 7797 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Creating a Routine for Civil3D zoomtosectionview
« 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.
Civil3D 2020

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Creating a Routine for Civil3D zoomtosectionview
« Reply #1 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.  

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Creating a Routine for Civil3D zoomtosectionview
« Reply #2 on: June 25, 2021, 01:17:58 PM »
Thank you Jeff for the direction! Much Appreciated!
Civil3D 2020