Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Member
ersegev
Posts: 3
Registered: ‎02-06-2013
Message 1 of 6 (410 Views)

PLine lisp command just dont wark

410 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.

 

*Expert Elite*
hmsilva
Posts: 2,778
Registered: ‎12-17-2004
Message 2 of 6 (406 Views)

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

Member
ersegev
Posts: 3
Registered: ‎02-06-2013
Message 3 of 6 (397 Views)

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

 

*Expert Elite*
hmsilva
Posts: 2,778
Registered: ‎12-17-2004
Message 4 of 6 (394 Views)

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

*Expert Elite*
pbejse
Posts: 2,460
Registered: ‎11-24-2009
Message 5 of 6 (382 Views)

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

Member
ersegev
Posts: 3
Registered: ‎02-06-2013
Message 6 of 6 (371 Views)

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

 

 

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.