Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
Here on the forum I found a lisp code that creates an xline perpendicular to the selected entity (line, polyline, circle, etc.). The code works as it should, but I would like to change it so that a parallel is created instead of the perpendicular. How to do it?
(defun c:perxl ( / *error* acadobj adoc crv msp perpt pt) (defun *error* ( msg ) (vla-EndUndoMark adoc) (if (not (wcmatch (strcase msg T) "*break*,*cancel*,*exit*")) (princ (strcat "Error: " msg)) ) ) (setq acadobj (vlax-get-acad-object) adoc (vla-get-ActiveDocument acadobj) msp (vla-get-ModelSpace adoc) ) (vla-StartUndoMark adoc) (while (progn (setq crv (entsel "\nSelect curve: ")) (cond ((null crv) (princ "\nNothing selected")) ((null (wcmatch (cdr (assoc 0 (entget (car crv)))) "LINE,*POLYLINE,ARC,CIRCLE,ELLIPSE,SPLINE")) (princ "\nObject is not a curve") ) ) ) ) (initget 1) (setq pt (getpoint "\nSpecify point: ") perpt (vlax-curve-getclosestpointto (car crv) pt) ) (vla-AddXline msp (apply 'vlax-3d-point pt) (apply 'vlax-3d-point perpt)) (vla-EndUndoMark adoc) )
Solved! Go to Solution.