Thread: ENTITY MODIFY BY SUBST VARIANT OF COORDINATES WITH NEW COORDINATES

1. Login to Give a bone

ENTITY MODIFY BY SUBST VARIANT OF COORDINATES WITH NEW COORDINATES

Hi, this stretch problem worked but now CAD is messing points to stretch on polyface mesh... So I am going to try in another way to transform polyface mesh...

I obtained point coordinates from polyface mesh with these lines:
(setq EA (vlax-ename->vla-object (car (entsel)))

... selecting polyface mesh ...

(setq EACoord (vla-get-Coordinates EA))
(setq EACoordList (vlax-safearray->list (vlax-variant-value EACoord)))

... from this list of point coordinates, I made new one in the same lisp value list form ...

I need to repalce this new coordinates list within EA object and modify it (I don't know how to do this - with ordinary lisp functions I used) :

(setq entlist (entget (car (entsel))))
(setq entlist (subst (cons ? newvalue) - "new value" (assoc ? entlist) - "old value" entlist))
(entmod entlist)

This entmod function is probably different in VLISP mode, and don't know weather should I use subst function...

Marko Ribar
please, answer if you know how to make this modification to EA object polyface mesh...

2. Login to Give a bone

Re: ENTITY MODIFY BY SUBST VARIANT OF COORDINATES WITH NEW COORDINATES

Thanks for nothing...

I've found solution by reading www about VLISP. Still result is that when modifying pface mesh it messes points that firstly calculates.
Solution consists from these set of functions that I found:

1. make safearray
(setq sfa (vlax-make-safearray vlax-vbdouble (cons 1 k))
where k is nuber of coordinates previously obtained from EA object (vla-get-Coordinates)
2. fill safearray with new coordinates - I've made firstly list of coordinates - ptlista
(vlax-safearray-fill sfa ptlista)
3. make variant from safearray
(setq var (vlax-make-variant sfa))
4. replace coordinates in EA object by replacing variant with new variant
(vla-put-Coordinates EA var)
5. update modified EA
(vla-update EA)

6. (setq ptlista nil) before CAD takes new EA in consideration...

All this functions, but result is that newly created pface meshes are unclear and messed with pface mesh edges that now intersectes each other...

So far, so good, because transformation performs very fast, much faster then useing old method for stretching:
(command "._STRETCH" "_Crossing" pt pt "" "_None" pt "_None" ptnew)
- see post GRIPEDIT by command line that I posted previously...

Marko Ribar, arch.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•