Print Page | Close Window

.lsp for setting PLs elev. to zero *current entity

Printed From: CAD Forum
Category: EN
Forum Name: CAD - general
Forum Description: General discussion about CAD, formats, standards, management, licensing, networking, harware, other CAD applications
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=10723
Printed Date: 25.May.2026 at 09:42


Topic: .lsp for setting PLs elev. to zero *current entity
Posted By: ebrody
Subject: .lsp for setting PLs elev. to zero *current entity
Date Posted: 08.Oct.2014 at 23:28
(defun C:EZ (); = Current-Entity Elevation to Zero
  (setvar 'Elevation 0.0)
); defun

This doesn't quite do it. To put into words what I'm attempting to accomplish, I'm looking to have my current selection entities set to a zero elevation. It would be alright as well to have to select the entities. 

Essentially I don't want to have to open the properties window to set the elevations to zero on two poly lines I'm trying to fillet which is what prompts this issue for me. 

Is there a different command/variable I should be using here?

Thanks for any help you can provide.



Replies:
Posted By: John Connor
Date Posted: 09.Oct.2014 at 00:40
You could use the FLATTEN command or do it using the old CHANGE command via the ELEVATION option.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: ebrody
Date Posted: 09.Oct.2014 at 14:54
Didn't know about that change command, and that was the ticket. Many thanks. Here's the completed .lsp for anyone else that wants it:

;;  ElevationtoZero.lsp [command names: EZ]
;;  Set Current Entity Elevation to Zero
;;  Ed Brodmarkle, October 8, 2014

(defun C:EZ (/ ss cmde); = Current-Entity Elevation to Zero
  (setq
    ss (cond ((ssget "_I")) ((ssget))); ask User if nothing pre-selected
    cmde (getvar 'cmdecho)
  ); setq
  (if ss
    (progn
      (setvar 'cmdecho 0)
      (sssetfirst nil); clears pre-selection [if any] to avoid object-selection problem
      (command "_change" ss ""
        "_Properties" "_Elev" 0.0 ""
      ); command
      (setvar 'cmdecho cmde)
    ); progn
  ); if
  (C:BYce)
  (princ)
); defun


Posted By: Kent Cooper
Date Posted: 10.Oct.2014 at 15:21
... for which you will need the BYce command, one of my group of ByLayer-related commands in the attached file:
http://www.cadforum.cz/forum_en/uploads/353260/ByLayer.lsp" rel="nofollow - uploads/353260/ByLayer.lsp
And consider whether, for the sake of the purpose of this thread, to add this line to it:
(setvar 'elevation 0.0)


Posted By: ebrody
Date Posted: 10.Oct.2014 at 17:56
Originally posted by Kent Cooper Kent Cooper wrote:

... for which you will need the BYce command, one of my group of ByLayer-related commands in the attached file:
http://www.cadforum.cz/forum_en/uploads/353260/ByLayer.lsp" rel="nofollow - uploads/353260/ByLayer.lsp
And consider whether, for the sake of the purpose of this thread, to add this line to it:
(setvar 'elevation 0.0)

Ah, I didn't see that I left off that modified code bit a little. As you could plainly see it's a modification of your awesome by layer commands. 

I tried the setvar 'elevation 0.0 and it didn't work. Not really sure why, but this command as written achieves the thing it needs to do.  Thanks for the help!



Posted By: ebrody
Date Posted: 10.Oct.2014 at 18:02
Originally posted by Kent Cooper Kent Cooper wrote:

... for which you will need the BYce command, one of my group of ByLayer-related commands in the attached file:
http://www.cadforum.cz/forum_en/uploads/353260/ByLayer.lsp" rel="nofollow - uploads/353260/ByLayer.lsp
And consider whether, for the sake of the purpose of this thread, to add this line to it:
(setvar 'elevation 0.0)

I just added a command similar to your BYce as a EZce which is the same just injecting that elevation line. Should be aight. 



Print Page | Close Window