Results 1 to 3 of 3

Thread: how to code in distances as stations (survey) map3d 2012 & civil3d 2012

  1. #1
    Member
    Join Date
    2012-02
    Posts
    2
    Login to Give a bone
    0

    Default how to code in distances as stations (survey) map3d 2012 & civil3d 2012

    I have a lisp program that uses a 3dpoly to draw a profile of existing ground elevations. Currently, the program only writes in distances as whole numbers (ie:500 or 1600) I would like it to write them as stations along the profile (ie: 0+500 or 1+600) does anyone have a peice of code for doing this?

  2. #2
    I could stop if I wanted to
    Join Date
    2002-08
    Posts
    231
    Login to Give a bone
    0

    Default Re: how to code in distances as stations (survey) map3d 2012 & civil3d 2012

    Hi,

    Perhaps this?

    Code:
    (vl-load-com)
    (defun c:test ( / sel obj_vlax pt ori_dist p_fix mantiss)
    	(setq
    		sel (entsel)
    		obj_vlax (vlax-ename->vla-object (car sel))
    		pt (vlax-curve-getClosestPointTo obj_vlax (cadr sel))
    		ori_dist (getreal "\nStart at 0+000 <0.0>: ")
    	)
    	(if (not ori_dist) (setq ori_dist 0.0))
    	(setq
    		p_fix (atoi (rtos (/ (vlax-curve-getDistAtPoint obj_vlax pt) 1000.0) 2 3))
    		mantiss
    		(+
    			(-
    				(vlax-curve-getDistAtPoint obj_vlax pt)
    				(* p_fix 1000.0)
    			)
    			(atoi (substr (rtos ori_dist 2 3) (+ 2 (vl-string-search "." (rtos ori_dist 2 3)))))
    		)
    	)
    	(if (or (equal mantiss 1000.0 1E-3) (> mantiss 1000.0)) (setq p_fix (1+ p_fix) mantiss (- mantiss 1000)))
    	(if (zerop (fix mantiss)) (setq mantiss "000") (setq mantiss (rtos mantiss 2 0)))
    	(print
    		(strcat
    			(itoa (+ p_fix (fix ori_dist)))
    			"+"
    			mantiss
    		)
    	)
    	(prin1)
    )

  3. #3
    Login to Give a bone
    0

    Default Re: how to code in distances as stations (survey) map3d 2012 & civil3d 2012

    perhaps you are looking for something like this..


Similar Threads

  1. 2012: Bridge modeler issue Civil3D 2012
    By bharathwajs428104 in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2014-02-19, 09:43 PM
  2. Is there a Maximum Network Size in Civil3D 2012?
    By AAristizabal in forum AutoCAD Civil 3D - General
    Replies: 2
    Last Post: 2012-08-30, 04:29 AM
  3. Replies: 2
    Last Post: 2012-07-03, 08:12 PM
  4. carril aceleracion en autocad civil3d 2012
    By ramonlbar944907 in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2012-05-27, 01:19 AM
  5. Manuales del Civil3D 2012
    By ing_rodrigoescalera598062 in forum AutoCAD Civil 3D - General
    Replies: 3
    Last Post: 2012-03-22, 04:55 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
  •