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
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
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.
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
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!
by the other words "be ready to pay for fixing our bugs again"
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?
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!!



