Results 1 to 2 of 2

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

  1. #1
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Question 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:
    (vl-load-com)
    (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. #2
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

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

Similar Threads

  1. 2013: How do I export to IFC with project coordinates and not real world coordinates?
    By m.knutsson in forum Revit Architecture - General
    Replies: 2
    Last Post: 2013-10-15, 06:54 AM
  2. Project Coordinates, Shared Coordinates, and the new Survey Point
    By Wes Macaulay in forum Revit - Platform
    Replies: 59
    Last Post: 2012-07-05, 06:20 PM
  3. Replies: 0
    Last Post: 2007-09-30, 02:56 PM
  4. Please HELP: how to modify a TOLERANCE entity
    By bradipos in forum AutoLISP
    Replies: 3
    Last Post: 2005-07-05, 06:09 PM

Posting Permissions

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