Author Topic: Setting Buffers on Profiles View Sides  (Read 7614 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!
Setting Buffers on Profiles View Sides
« on: September 08, 2021, 09:22:09 AM »
I have been trying to figure out how to modify a profile view from automatic to creating side buffers.

This is currently what I have, however, I am having issues getting the stationbegin to work and getting hard coded values in place instead of the user typing it in.

Code: [Select]
(defun c:AdjustSides ( / pv pro leftbuf rightbuf beginpro endpro);
(vl-load-com)
(setq proview (vlax-ename->vla-object (car (entsel "\nSelect Profile View: "))))
  (while (not (= (vlax-get proview 'ObjectName) "AeccDbGraphProfile"))
    (setq proview (vlax-ename->vla-object (car (entsel "\nYou must select a Profile View. Try again: "))))
    )
(setq pro (vlax-ename->vla-object (car (entsel "\nSelect Profile: "))))
  (while (not (= (vlax-get pro 'ObjectName) "AeccDbVAlignment"))
    (setq pro (vlax-ename->vla-object (car (entsel "\nYou must select a Profile. Try again: "))))
    )
(setq leftbuf (getreal "\nEnter Left buffer: ")    ;;;How Could I Hardcore a Value (-25)
      rightbuf (getreal "\nEnter Right buffer: ")  ;;;How Could I Hardcore a Value (50)
  )
(setq beginpro (vlax-get pro 'StationBegin)
  endpro (vlax-get pro 'StationEnd)
  )
(vlax-put pv 'StationLocked :vlax-false)
(vlax-put pv 'StationBegin (- beginpro leftbuf))
(vlax-put pv 'StationEnd (+ endpro rightbuf))
(princ))

Thanks for any help.
Civil3D 2020