CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 6518
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
ebrody View Drop Down
Groupie
Groupie


Joined: 20.Mar.2014
Location: United States
Using: AutoCAD Civil 3D 2013
Status: Offline
Points: 26
Direct Link To This Post Topic: .lsp for setting PLs elev. to zero *current entity
    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.
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post 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.


Edited by John Connor - 09.Oct.2014 at 15:03
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
ebrody View Drop Down
Groupie
Groupie


Joined: 20.Mar.2014
Location: United States
Using: AutoCAD Civil 3D 2013
Status: Offline
Points: 26
Direct Link To This Post 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
Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 626
Direct Link To This Post 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:
And consider whether, for the sake of the purpose of this thread, to add this line to it:
(setvar 'elevation 0.0)
Back to Top
ebrody View Drop Down
Groupie
Groupie


Joined: 20.Mar.2014
Location: United States
Using: AutoCAD Civil 3D 2013
Status: Offline
Points: 26
Direct Link To This Post 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:
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!

Back to Top
ebrody View Drop Down
Groupie
Groupie


Joined: 20.Mar.2014
Location: United States
Using: AutoCAD Civil 3D 2013
Status: Offline
Points: 26
Direct Link To This Post 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:
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. 
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,367 seconds.