Message 1 of 7
perpendicular Block insert at distance from starting point on a pline

Not applicable
03-26-2021
02:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Guys and h Gurus,
i have really need of your help improoving and now let my code work
in my daily jobs i have to take hand measurement on cloth and report on plines inserting a perpendicular block that can be read from my converter
i know the existance of PUT.lsp but is not exactly what i want, and no learning by copy paste
that is my starting code:
i think a obj ename conversion error on (setq pt2... line
still studing lisp please have mercy
(defun C:block_from_distance (/ plsel p1 p2 cumdist nextdist pt2 pt1 pt );(vl-load-com)); if needed
(if (setq plsel (entsel "\nSelect Polyline: "))
(progn
(setq
pl (car plsel)
pt (osnap (getpoint "\nstarting point ") "_nea")
cumdist (vlax-curve-getDistAtPoint pl pt)) ; setq
;(setvar 'osmode 0)
(command "_.insert" "BLOCKNAME" pt "" "" "")
(while
(setq nextdist (getdist "\nDistance: "))
(setq cumdist (+ cumdist nextdist))
(setq pt1 (trans (vlax-curve-getPointAtDist pl cumdist) 1 0))
(setq pt2 (vlax-curve-getClosestPointTo ( vlax-vla-object->ename ( vla-offset ( vlax-ename->vla-object ( plsel ) 2 ))) pt1 ) )
(setq an ( getangle (pt1 pt2 )))
(command "_.insert" "" (vlax-curve-getPointAtDist pl cumdist) "" "" an)
) ; while
) ; progn
); if
); defun