4
16
12
初来乍到
使用道具 举报
1
1069
1050
初露锋芒
;; written by Fatty T.O.H. ()2004 * all rights removed;; edited 6/5/10;; Stationing;;load ActiveX library(vl-load-com);;local defuns;;//(defun start (curve) (vl-catch-all-apply (function (lambda() (vlax-curve-getclosestpointto curve (vlax-curve-getstartpoint curve ) )) ) ) );;//(defun end (curve) (vl-catch-all-apply (function (lambda() (vlax-curve-getclosestpointto curve (vlax-curve-getendpoint curve ) )) ) ) );;//(defun pointoncurve (curve pt) (vl-catch-all-apply (function (lambda() (vlax-curve-getclosestpointto curve pt ) )) ) );;//(defun paramatpoint (curve pt) (vl-catch-all-apply (function (lambda() (vlax-curve-getparamatpoint curve pt ) )) ) );;//(defun distatpt (curve pt) (vl-catch-all-apply (function (lambda() (vlax-curve-getdistatpoint curve (vlax-curve-getclosestpointto curve pt) ) ) ) ) );;//(defun pointatdist (curve dist) (vl-catch-all-apply (function (lambda() (vlax-curve-getclosestpointto curve (vlax-curve-getpointatdist curve dist) ) )) ) );;//(defun curvelength (curve) (vl-catch-all-apply (function (lambda() (vlax-curve-getdistatparam curve (- (vlax-curve-getendparam curve) (vlax-curve-getstartparam curve) ) ) )) ) );;//(defun distatparam (curve param) (vl-catch-all-apply (function (lambda() (vlax-curve-getdistatparam curve param ) ) ) ) );;//(defun statlabel (num step);; num - integer, zero based;; step - double or integer, must be non zero (strcat (itoa (fix (/ num 2.)) ) "+" (rtos (* (* step 2) (- (/ num 2.) (fix (/ num 2.)))) 2 2) ) );;//(defun insertstation (acsp bname pt rot tag num step / block) (vl-catch-all-apply (function (lambda() (setq block (vlax-invoke-method acsp 'InsertBlock pt bname 1 1 1 rot)) ) ) ) (changeatt block tag (statlabel num step))block );;//(defun changeatt (block tag value / att) (setq atts (vlax-invoke block 'GetAttributes)) (foreach att atts