raise the z-value of all drawing entities

hello everybody,is it possible to raise (or loweer) via vba the z-value aof all drawing entities or have i to run through all entities, check what kind of entity it is and change the value according to the kind of entity?thanks helmut

Comments

  • I've not tried this on Bricscad, only AutoCad, but you can select multiple entities then open the properties window and edit the Z coordinate value. I don't know how this will work on things like ACIS solids, or 3d polylines.You might use a selection filter to find the kinds of entities you want to change, or filter out the ones you don't.Joe Dunfee

  • I have writen applications roughly simular to this.The main problem you run into is that not all object have a z coordinate as such. A simple polyline (2d) has 2d points in the ucs it was created in. The points that define the line actualy have a z coodinate, but raining it does not raise the location of the line in the drawing (if you look at the properties of the line, the Z coordinate is grayed out).In my own program, I knew the orietation of such objects, and gererated a new drawing, with only true 2d objects, with points I calculated with the input of the entities in the original drawing.It is a lot of work, especialy if you want it to work with all entities.wat is your ultimate goal? in other words, what would you like the program to do?Regards,Huib.

  • Here is a LISP routine that can be helpful.;;;;;; Change of Z_value of entities by entering the difference in height.;;(Defun C:CHGOVA (/ dif e n ss gova gova1 gova$ gova1$ ly$ ly2 count ptss blss rec recnew x y z) (SetQ ly$ (cdr (assoc 8 (entget (car (entsel "\nPick a Text Layer to Modify...")))))) (Princ (Strcat "\nChanging Text on Layer * " ly$ " *" )) (SetQ ly2 (cdr (assoc 8 (entget (car (entsel "\nPick a Point Layer to Modify...")))))) (Princ (Strcat "\nChanging Hight of points on Layer * " ly2 " *" )) (Princ "\n!!! Changing Hight of all BLOCKs on all LAYERs !!!") (SetQ dif (GetReal "\nDifference [+/-]..: ")) (SetQ ss (ssGet "X" (list (cons '0 "text") (cons '8 ly$)))) (SetQ ptss (ssGet "X" (list (cons '0 "POINT") (cons '8 ly2)))) (SetQ blss (ssGet "X" (list (cons '0 "INSERT")))) (SetQ n -1 count (sslength ss)) (Repeat count (prompt ".") (SetQ e (EntGet (ssName ss (SetQ n (1+ n)))) ; n=„…Ž gova$ (cdr (assoc 1 e)) gova1$ (substr gova$ (- (strlen gova$) 2) 3) ;…™‰‡ Š˜…–Œ ‰—Œ‡Œ „…‚„ —…˜‰” gova1 (/ (Atof gova1$) 100) gova (Atof gova$) gova$ (Rtos (+ gova gova1 dif)) gova1$ (substr gova$ (- (strlen gova$) 1) 2) ;TXT - Œ ™ƒ‡Ž „…‚„ š‹˜„ gova$ (substr gova$ 1 (- (strlen gova$) 3)) gova$ (strcat gova$ " " gova1$) ) (EntMod (SetQ e (Modify e '1 gova$))) );;;;;;;;;;;;;;;;;;;;;; (SetQ n -1 count (sslength ptss)) (Repeat count (SetQ e (EntGet (ssName ptss (SetQ n (1+ n)))) rec (cdr (assoc 10 e)) x (car rec) y (cadr rec) z (+ (caddr rec) dif) recnew (list x y z) ) (EntMod (SetQ e (Modify e '10 recnew))) ) ;repeat (If blss (progn (SetQ n -1 count (sslength blss)) (Repeat count (prompt ".") (SetQ e (EntGet (ssName blss (SetQ n (1+ n)))) rec (cdr (assoc 10 e)) x (car rec) y (cadr rec) z (+ (caddr rec) dif) recnew (list x y z) ) (EntMod (SetQ e (Modify e '10 recnew))) ) ;repeat ) ) (Princ (Strcat "\nLayers: * " ly2 "," ly$ " * were changed, as well as all BLOCKS !" )) (terpri))(c:chgova)

  • If I'm understanding your question correctly, it seemsthat you just need to use the MOVE command...ie:MOVEALL0,0,00,0,z...z being the amount you want to change the z-values.

  • the more interesting thing to do, and maybe the original request, was how to move a set of entities that are at different elevations - all to a certain z coordinate , not move them all by a deltaZ. can't seem to be able to edit it in the prop dialog like in acad, and a lisp i had (movetoz.lsp, protected) that worked in acad doesnt in bricscad. any ideas?

  • try thisflattenpick what you wantset z

This discussion has been closed.