CAD software discussion forum > CAD > polyline coords in LISP

polyline coords in LISP

Rank: 1

Alin Dobrescu

Newbie

posts: 0

Registered: 2009-4-14

Message 1 of 8

14-04-2009 03:22 . am | View his/her posts only
Hi,

I tried to get LWPolyline coords using vlax functions but I can't convert the points to a list.
I'm trying to migrate from ACAD but I have some little problems,as you can see Cry.

My code:

(setq curba (entlast))
(setq curba_obj (vlax-ename->vla-object curba)
coords (vlax-get-property curba_obj 'Coordinates)
coords (vlax-safearray->list coords)
)

The vlax-safearray->list leads to a "bad argument type" error.

Please let me know how to solve this.

Thx,

ALin

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 2 of 8

18-04-2009 03:54 . pm | View his/her posts only


In general, you can create a LIST according to the following method in LISP application:







(vl-load-com)




(setq myent (car(entsel "please select a polyline 'n")))




(setq my-vla-obj (vlax-ename->vla-object myent))









(setq temp1 (vlax-get-property my-vla-obj 'coordinates))




(setq temp2(vlax-variant-value temp1))




(setq my-list(vlax-safearray->list temp2))






But, the return value of (vlax-get-property my-vla-obj 'coordinates) in ZWCAD is different from AutoCAD, which stops the (vlax-variant-value temp1) function getting the value of coordinates. We are trying to solve the problem, and the solution will be sent to you as soon as possible. Sorry for the inconvenient.

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 3 of 8

23-06-2009 11:52 . pm | View his/her posts only
Any solution for this post, or an Workaround?

Rank: 1

disedig

Newbie

posts: 0

Registered: 2011-11-30

Message 4 of 8

 polyline coords in LISP
05-10-2010 08:27 . pm | View his/her posts only
Hello all!

I have the same error in zwcad 2010 vernum 30-06-2010 :

(setq ent_pol (entsel "'nSelect poly: ")) 'Ok

(setq ss_ob (vlax-ename->vla-object (car ent_pol))) 'Ok

(setq ss_pts (vlax-get-property ss_ob 'coordinates)) <---- Here fails


Very strange, it ran ok in vernum 12-12-2009

Regards,

William

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 5 of 8

 polyline coords in LISP
05-10-2010 08:27 . pm | View his/her posts only
Dear wcastillog.

We have tested and it was a but in 2010 version. But now it has been fixed, and will be present in 2011version, please pay attention to it, it will be released in Nov or Dec this year. Thanks!

Rank: 1

vlad_simple

Newbie

posts: 0

Registered: 2011-10-17

Message 6 of 8

18-10-2010 04:39 . am | View his/her posts only

by the other words "be ready to pay for fixing our bugs again"

Rank: 1

disedig

Newbie

posts: 0

Registered: 2011-11-30

Message 7 of 8

 polyline coords in LISP
05-10-2010 08:27 . pm | View his/her posts only
You have a good point Vlad_Simple, I'm a application developer also zwcad partner. This bugs has been a real pain.

Anyway, I know zwcad staff are trying the best to improve, personally I think "The perfection is enemy of the Good" or should I say: of the Cheap?

Rank: 1

Belicoff

Newbie

posts: 0

Registered: 2010-11-9

Message 8 of 8

 polyline coords in LISP
05-10-2010 08:27 . pm | View his/her posts only


It can be a problem when we cannot find a
solution to our problem like not being able to get the covert the points to the
list in spite of using the LWPolypine cords using the necessary functions!! The
code has been given which means that someone will be able to look into it and come
up with a solution which will benefit others having the same problem!!




See also