Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PLine lisp command just dont wark

5 REPLIES 5
Reply
Message 1 of 6
ersegev
2057 Views, 5 Replies

PLine lisp command just dont wark

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.

 

5 REPLIES 5
Message 2 of 6
hmsilva
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

EESignature

Message 3 of 6
ersegev
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

 

Message 4 of 6
hmsilva
in reply to: ersegev

You're welcome, Eran
glad you got a solution

 

Henrique

EESignature

Message 5 of 6
pbejse
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

Message 6 of 6
ersegev
in reply to: ersegev

Once again,

Many manu thanks for the wonderful help.

Your solutions really inspire me.

Eran

 

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost