Modify Elevation Lisp w/DCL (ModZ)

Modify Elevation Lisp w/DCL (ModZ)

Jonathan3891
Advisor Advisor
1,930 Views
2 Replies
Message 1 of 3

Modify Elevation Lisp w/DCL (ModZ)

Jonathan3891
Advisor
Advisor

While learning DCL I created this lisp & DCL. 

 

It allows you to modify the elevation. It gives you the ability to select objects or modify everything.

I searched to see if anything similar existed but I didnt find anything, so I wanted to share with the community. Maybe you will find it useful

 

Its based on something I use frequently in MicroStation.

 

Constructive criticism is welcome!


Jonathan Norton
Blog | Linkedin
0 Likes
1,931 Views
2 Replies
Replies (2)
Message 2 of 3

john.uhden
Mentor
Mentor

I am thrilled to see you mastering the use of AutoLisp with DCL.

 

Just for some constructive criticism, I wonder about your use of the symbol Elv.  It seems to be a string, but then your SaveVars function converts it into a real, but then since it is local to SaveVars, it is not really saved at all.

 

Also, since I am a little ignorant, I didn't realize that the Change command can accept a string as a real.  Thank you for demonstrating that.

 

Now to be really picky, I don't like your use of the symbol name "flag."  I prefer to name the result of (done_dialog) as "action" with "flag' reserved for something like the 70 code for a layer entity.  Hey, whatever with which you are comfortable is really what counts.

 

Thank you for sharing.

John F. Uhden

0 Likes
Message 3 of 3

paullimapa
Mentor
Mentor

Very nicely done.

 

I would also declare all your variables including the subroutine saveVars local only to be used with this modz function like this:

 

(defun c:modz (/ dcl_id flag saveVars ss ssi)

 (defun saveVars(/ Elv)
  (setq Elv(distof(get_tile "Elv")))
 )

 

The next thing to try would be to include in the lisp function a routine to write the dcl file on the fly to the temp folder location (getenv"temp").  Then have a routine to load the dcl from this temp folder location and after the routine is complete, delete the dcl file.

 

Keep at it.....you're doing really well.

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes