Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. If Architectural units are being used, entering 2.6 in the Text Height box would make the text 2.6" in Architectural format that's shown as 2- 15/32". The equivalent to 2.6mm text height for Architectural is 1/8" or .125".
  3. But wouldn't undo change it back to original length? Still looking to decipher this one, probably tomorrow when I get back to work.
  4. Today
  5. Thanks ı got the part of ı needed.
  6. Yesterday
  7. If all the primitives (TEXT,MTEXT,INSERT,LINE,LWP,Circle,Mleader,Dimension) are perceived as objects, then you can use this code: ;; Set coordinates of objects (TEXT,MTEXT,INSERT,LINE,LWP,Circle,Mleader,Dimension) Z in 0 (defun zeroz-in-list (lst /) (cond ;; The list of coordinates-vertex ((and (listp lst) (= (length lst) 2) (numberp (car lst)) (numberp (cadr lst))) ;; if only XY - expanding to XYZ (list (car lst) (cadr lst) 0.0) ) ((and (listp lst) (= (length lst) 3) (numberp (car lst)) (numberp (cadr lst)) (numberp (caddr lst))) ;; if already XYZ - just do Z=0.0 (list (car lst) (cadr lst) 0.0) ) ;; If it's a large list, it's probably nested ((listp lst) (mapcar 'zeroz-in-list lst) ) (t lst) ) ) (defun c:ObjZ0 (/ ss n e el newel) (prompt " Select objects (all types, including polylines, mleader, dimension): ") (if (setq ss (ssget)) (progn (setq n 0) (while (< n (sslength ss)) (setq e (ssname ss n) el (entget e) newel nil ) (foreach pair el (cond ;; height LWPOLYLINE (code 38) ((and (= (car pair) 38) (numberp (cdr pair))) (setq newel (cons (cons 38 0.0) newel)) ) ;;Point codes (for example, 10, 11, 12...), etc. ((and (numberp (car pair)) (not (= (car pair) 210))) ; Don't touch the normal (if (listp (cdr pair)) (setq newel (cons (cons (car pair) (zeroz-in-list (cdr pair))) newel)) (setq newel (cons pair newel)) ) ) ;; The rest (t (setq newel (cons pair newel))) ) ) ;; Restoring order and modifying the object (entmod (reverse newel)) (setq n (1+ n)) ) ) ) (princ) ) If the Z coordinate is not displayed in the properties (example, for dimensions, for Mleader), then you need to use the _LIST command. Don't think of me as a programmer... The code is written using AI.
  8. Use what you have done previously but for dx code 10: (foreach dxf le (if (= (car dxf) 10) (setq le (subst (cons 10 (zeroz (cdr dxf))) dxf le)) ) )
  9. Oh OK. Thanks for mentioning
  10. Yes I briefly forgot that LWPOLYLINES don't have a Z coordinate and instead use group 38 to define their elevation. Therefore @shokoufeh: the code you added to set the Z for LWPOLYLINES is unnecessary
  11. so, how should I change the code?
  12. Missed your message but am intrigued now... (a guess I would say you were saying LWPolyline has X, Y, Z coords - I've done the same many times too)
  13. I think hatch is the first '10' if an elevation has been set (10 0.0 0.0 'Z')
  14. I was checking my files and I found out another problem. Except elements I mentioned (lines, poly lines, texts and blocks), the problem with Z values exist in other elements, as I mention below: Hatch: Elevation Leader: Vertex Z Ellipse: Start Z, Center Z, End Z Arc: Start Z, Center Z, End Z Circle: Center Z Solid: Elevation Attribute Definition: Text Alignment Z Array (Rectangular) : Base Z Please check this modified lisp and see if it is correct or not. This lisp doesn't work on HATCH. ZRemove.lsp
  15. Enter 2.6 in the Text Height box.
  16. Sorry: That problem will never exist in a LWPOLYLINE: Forget what I said, if you managed to read the previous message
  17. Sorry: The problem I referred to will never exist in a LWPOLYLINE: Forget what I said, if you managed to read the previous message
  18. There was a thread a few days ago about speeding up a LISP to do the same, have look at that for ideas. I think the thread got as far as arcs are tricky to do with LISPs. You could use the flatten command for small drawings. This snippet will filter a selection set to lines or LWPolylines to anything not 0 Z (setq MySS (ssget (list (cons 0 "*TEXT,INSERT,LINE,LWPOLYLINE") '(-4 . "<OR") '(-4 . "*,*,<>") (list 10 0.0 0.0 0.0) '(-4 . "*,*,<>") (list 11 0.0 0.0 0.0) '(-4 . "<>") (cons 38 0) '(-4 . "OR>") )) ; end list, end ssget ) Can be added to the other solutions herein the case that your drawing has a lot of lines / polylines / blocks it speeds it up a bit Link to other thread:
  19. Sounds good If you've tried it and it works:
  20. GREAT. It works. Thank you very much
  21. Try again (defun c:todoA0 (/ cj e le n to p1 p2) (IF (setq cj (ssget "x" '((0 . "TEXT,MTEXT,INSERT,LINE,LWP*")))) (while (setq e (ssname cj (setq n (if n (1+ n) 0)))) (setq le (entget e) to (cdr (assoc 0 le)) p1 (assoc 10 le) ) (cond ((= to "LINE") (setq p2 (assoc 11 le)) (entmod (subst (cons 10 (list (cadr p1) (caddr p1) 0.0)) p1 le)) (entmod (subst (cons 11 (list (cadr p2) (caddr p2) 0.0)) p2 (entget e))) ) ((= to "LWPOLYLINE") (entmod (subst (cons 38 0.0) (assoc 38 le) le)) ) ((member to '("TEXT" "MTEXT" "INSERT")) (entmod (subst (cons 10 (list (cadr p1) (caddr p1) 0.0)) p1 le)) ) ) ) ) (princ) )
  22. Please check this code. I made a few modification, and I think now it works for both start and end Z values. ZRemove.txt
  23. Z Value Problem-modified.dwg
  24. Wow It worked great. thank you very much. just one last question: Only "End Z" of lines are being modified to Zero. how can I make this modification to "Start Z" of lines, too?
  25. Try (defun c:todoA0 (/ cj e le n to p1 p2) (IF (setq cj (ssget "x" '((0 . "TEXT,MTEXT,INSERT,LINE,LWP*")))) (while (setq e (ssname cj (setq n (if n (1+ n) 0)))) (setq le (entget e) to (cdr (assoc 0 le)) p1 (assoc 10 le) ) (cond ((= to "LINE") (setq p2 (assoc 11 le)) (entmod (subst (cons 10 (list (cadr p1) (caddr p1) 0.0)) p1 le)) (entmod (subst (cons 11 (list (cadr p2) (caddr p2) 0.0)) p2 le)) ) ((= to "LWPOLYLINE") (entmod (subst (cons 38 0.0) (assoc 38 le) le)) ) ((member to '("TEXT" "MTEXT" "INSERT")) (entmod (subst (cons 10 (list (cadr p1) (caddr p1) 0.0)) p1 le)) ) ) ) ) (princ) )
  26. thank you. It seems that this lisp finds the lines with Z value problem and adds a label near them. It is great that it can find the lines, but I don't want this label to be added near this lines. I only need to select them. Can this lisp file be modified, so that it changes the Z values of the selected lines, to Zero? I mean, it selects the lines and modifies the "Start Z" and "End Z" to 0.
  27. thanks. I will see how I go creating the dynamic block. It does sound like what I want
  28. try this one. ZLABEL-Label Z Values On Topography Lines.fas
  1. Load more activity
×
×
  • Create New...