Why not just shell out the $7500 for a seat of Civil-3D? :lol:
(defun c:ChainageMark()
(setq Pl1Name (car (entsel"\nPick Centerline "))
StaInterval (getreal "\nEnter Chainage Interval ")
MarkLength (getreal "\nEnter Tick Length ")
CurrStation StaInterval ; change to 0 if mark is needed at start of pline
MaxLength (vlax-curve-getDistAtPoint Pl1Name (vlax-curve-getEndPoint Pl1Name))
currLayer (getvar "CLAYER") ; change as needed
);setq
(while (< CurrStation MaxLength)
(setq currPoint (vlax-curve-getPointAtDist Pl1Name currStation)
currParam (vlax-curve-getParamAtDist Pl1Name currStation)
PerpAng (dkb_getPerp Pl1Name currParam 1)
Pt1 (polar currPoint PerpAng (* MarkLength 0.5))
Pt2 (polar currPoint PerpAng (* MarkLength -0.5))
currStation (+ currStation StaInterval)
LineList (list
'(0 . "LINE")
'(100 . "AcDbEntity")
'(100 . "AcDbLine")
(cons 8 currLayer)
(cons 10 Pt1)
(cons 11 Pt2)
);list
);setq
(entmake LineList)
);while
); defun chainageMark
(defun dkb_getPerp (pCurve pParam pDir / ang1 oCurve zeroPt deg90 Bulge1 FirstDeriv pt1 Rp1 )
;; function to return the perpindicular angle of a Pline at a given parameter and a direction left or right based
;; on looking up-station left=-1 right = 1
(setq oCurve (dkb_getOrCreateVlaObject pCurve)
zeroPt '(0.0 0.0 0.0)
deg90 (atan 1 0)
FirstDeriv (vlax-curve-getFirstDeriv oCurve pParam)
ang1 (angle zeroPt FirstDeriv)
;;correct for the desired side of the line
ang1 (+ ang1 (* -1 pDir deg90))
);setq
);defun end function dkb_getPerp
(defun dkb_GetOrCreateVlaObject(pEntOrObj / oPl)
(if (not (equal (type pEntOrObj) 'VLA-OBJECT))
(setq oPl (vlax-ename->vla-object pEntOrObj))
(setq oPl pEntOrObj)
); if
oPl
);defun dkb_GetorCreateVlaOjbect
(prin1);load cleanly
topographer,Don't hold your breathe.
....
You have to help yourself a little and start a bit of coding.
Learn to fish.
ymg
CurrStation StaInterval ; change to 0 if mark is needed at start of pline
(setq Pl1Name (car (entsel"\nPick Centerline "))
StaInterval (getreal "\nEnter Chainage Interval ")
MarkLength (getreal "\nEnter Tick Length ")
CurrStation 0 ; change to 0 if mark is needed at start of pline
MaxLength (vlax-curve-getDistAtPoint Pl1Name (vlax-curve-getEndPoint Pl1Name))
currLayer (getvar "CLAYER") ; change as needed
);set