• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    Member
    Posts: 3
    Registered: ‎02-06-2013

    PLine lisp command just dont wark

    101 Views, 5 Replies
    02-06-2013 02:36 PM

    Hello, 

    I'm asking for your help in a very simple but extremely fustrating issue.

    I'm using List pline command to draw rectangulars.

    Some of them are drawn correctly, but on some the vextex ends uo united. for example with the following command:

    (command "PLINE" (list 9.65 10.35) (list 0.65 1.35) (list 1.35 0.65) (list 10.35 9.65) "close" )

    I get a strait line instade of a rectangular.

     

    Please help me.

    P.S. I use Autocad 2012 for MAc.

     

    Please use plain text.
    *Expert Elite*
    Posts: 1,212
    Registered: ‎12-17-2004

    Re: PLine lisp command just dont wark

    02-06-2013 02:49 PM in reply to: ersegev

    ersegev,
    perhaps something like

     

    (command ".pline")
    (foreach Pt '((9.65 10.35) (0.65 1.35) (1.35 0.65) (10.35 9.65)) (command Pt))
    (command "c")

     EDITED

     

    set "OSMODE" to zero and see if it makes difference

     

     

    hope that helps

    Henrique

    Please use plain text.
    Member
    Posts: 3
    Registered: ‎02-06-2013

    Re: PLine lisp command just dont wark

    02-06-2013 03:33 PM in reply to: hmsilva

    Dear Henrique

     

    Eventually it was indeed the OSMODE.

    I have no idea whay even when specifically entering vertex coordinates it insists on snaping them to other coordinates.

    Any way once I turned OSMODE to 0 it worked great.

     

    Many thanks for your help.

    Eran

     

    Please use plain text.
    *Expert Elite*
    Posts: 1,212
    Registered: ‎12-17-2004

    Re: PLine lisp command just dont wark

    02-06-2013 03:39 PM in reply to: ersegev

    You're welcome, Eran
    glad you got a solution

     

    Henrique

    Please use plain text.
    *Expert Elite*
    Posts: 2,065
    Registered: ‎11-24-2009

    Re: PLine lisp command just dont wark

    02-06-2013 07:01 PM in reply to: ersegev

    ersegev wrote:

    Dear Henrique

     

    Eventually it was indeed the OSMODE.

    I have no idea whay even when specifically entering vertex coordinates it insists on snaping them to other coordinates.

    Any way once I turned OSMODE to 0 it worked great.

     

    Many thanks for your help.

    Eran

     


    another approach to consider is using entmakex.

     

    (defun LWPoly (lst cls)
      (entmakex
        (append (list (cons 0 "LWPOLYLINE")
    		  (cons 100 "AcDbEntity")
    		  (cons 100 "AcDbPolyline")
    		  (cons 90 (length lst))
    		  (cons 70 cls)
    	    )
    	    (mapcar (function (lambda (p) (cons 10 p))) lst)
        )
      )
    )

     

    lst = point list/vertex coordinates

    cls= Close/not close

     

    Will work regardless of osmode settings, plus you can supply other properties such as layer, color, lineweight etc....

    by adding the properties as an argument 

     

    (defun LWPoly (lst cls lay lw col)

    ....

    )

     

    HTH

    Please use plain text.
    Member
    Posts: 3
    Registered: ‎02-06-2013

    Re: PLine lisp command just dont wark

    02-06-2013 10:45 PM in reply to: ersegev

    Once again,

    Many manu thanks for the wonderful help.

    Your solutions really inspire me.

    Eran

     

     

     

    Please use plain text.