Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
AutoCAD for Mac Forum
Welcome to Autodesk’s AutoCAD for Mac Forums. Share your knowledge, ask questions, and explore popular AutoCAD for Mac topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autocad for mac lisp

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
bedyr
702 Views, 4 Replies

Autocad for mac lisp

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)
)
4 REPLIES 4
Message 2 of 5
maxim_k
in reply to: bedyr

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
Message 3 of 5
bedyr
in reply to: maxim_k

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?

Message 4 of 5
maxim_k
in reply to: bedyr

>>>>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
Message 5 of 5
bedyr
in reply to: maxim_k

Can we change this for true direction?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report