Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Autocad for mac lisp

bedyr
Advocate

Autocad for mac lisp

bedyr
Advocate
Advocate

hi,

are anybody can convert this lisp to for mac?

 

(defun c:PF (/ dd mm p1 p2 is nk1 nk2)
  (setq dd t)
  (setq mm 5)
  (setq obj (vlax-get-acad-object))
  (setq doc (vla-get-ActiveDocument obj))
  (setq ms (vla-get-ModelSpace doc))
  (if (setq p1 (getpoint "\nFirst Point:"))
    (progn
      (while dd
(if (setq p2 (getpoint p1 "\nOther Point:"))
 (progn
   (setq ss (ssget "c" p2 p2))
   (ifss
     (setq is -)
     (setq is +)
   )
   (setq nk1 p1
 nk2 (polar p1 (angle p1 p2) (is (distance p1 p2) mm))
   )
   (vla-addline ms (vlax-3d-point nk1) (vlax-3d-point nk2))
   (setq p1 nk2)
 )
 (progn
   (setq dd nil)
 )
)
      )
    )
  )
  (princ)
)
0 Me gusta
Responder
Soluciones aceptadas (1)
753 Vistas
4 Respuestas
Respuestas (4)

maxim_k
Consultant
Consultant
Solución aceptada

Here it is, "converted" for Mac:

(defun c:PF (/ dd mm p1 p2 is nk1 nk2)
  (setq dd t)
  (setq mm 5)
  ;(setq obj (vlax-get-acad-object))
  ;(setq doc (vla-get-ActiveDocument obj))
  ;(setq ms (vla-get-ModelSpace doc))
  (if (setq p1 (getpoint "\nFirstPoint:"))
    (progn
      (while dd
	(if (setq p2 (getpoint p1 "\nOtherPoint:"))
	  (progn
	    (setq ss (ssget "c" p2 p2))
	    (if	ss
	      (setq is -)
	      (setq is +)
	    )
	    (setq nk1 p1
		  nk2 (polar p1 (angle p1 p2) (is (distance p1 p2) mm))
	    )
	    ;(vla-addline ms (vlax-3d-point nk1) (vlax-3d-point nk2))
	    (command "LINE" nk1 nk2 "")
	    (setq p1 nk2)
	  )
	  (progn
	    (setq dd nil)
	  )
	)
      )
    )
  )
  (princ)
)

But I'm not sure this routine (even in "AC for Windows" variant) will give you results you need.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

bedyr
Advocate
Advocate

Thank you so much. Can we change this lisp a little? 

If an object opposite of my direction that is working true but if nothing opposite of direction it is not working what I want. Can we can this for mouse actions to select offset side?

0 Me gusta

maxim_k
Consultant
Consultant

>>>>If an object opposite of my direction that is working true
On my side the routine doesn't work correctly in any direction - it doesn't create lines parallel to existing with 5 units offset (red lines are the resulting lines):

2019-08-25_22-01-12.png

 

Or I'm missing something?


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

bedyr
Advocate
Advocate

Can we change this for true direction?

0 Me gusta