Search the Community
Showing results for tags 'transformation'.
-
Hi! First of all sorry for my poor english. I'm total beginner in AutoLISP, I work mostly with GIS software and data, but i have to manage the following problem. I've recieved a big DWG file which is containing around 30000 entities with various entity types and several layers. Everything is in a custom local coordinate system, and I have to transform it into an other coordinate system. I only have the transformation equations, so I create my first AutoLISP file based on codes I've found on this and other forums: (defun c:customtransform() (if (setq ss (ssget "_:L")) (repeat (setq i (sslength ss)) (setq entitylist (entget (ssname ss (setq i (1- i))))) (setq obj (ssname ss i)) (setq new nil) (repeat (setq j (length entitylist)) (if (= 10 (car (nth (setq j (1- j)) entitylist))) (progn (setq x (cadr (nth j entitylist)) y (caddr (nth j entitylist)) ) (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y))) (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y))) (setq new (cons (list 10 x y) new)) ) (setq new (cons (nth j entitylist) new)) ) ) (entdel obj) (entmake new) ) ) (princ) ) It mostly does what I want, but there are 3 problems: 1. It does not move objects with MLINE and REGION entity type. 2. It transforms only a part of the LINE and 3D FACE entities. For example: one node of a LINE entity moves into the new position and the other node remains in the original position, so the result is a long line, with one node in the correct position and one node in the old position. 3. It works perfectly with most of the TEXT entities, but there are some TEXTs that remain in their original positions, and I can't find out what is the difference between the "working" texts and the "non-working" texts. Any advice how to fix the problems mentioned above? Thanks for any help!