PDA

View Full Version : Elevation Lisp?



gapple
2004-06-10, 10:25 AM
Hi. Glad to see the forums are back!!!
Can anybody point me to a lisp routine that will make all lines & arcs the same elevation as the CURRENT ucs? The autocad "flatten" command, as well as a lisp routine I found on the internet by the same name, only flattens to WORLD ucs...

Thanks!

drawingisfun
2013-06-12, 02:30 AM
Unfortunately I don't have time to rewrite the flatten command, but this is one way to adjust objects z to match ucs z (hint trans converts a coordinate from UCS to WCS, or visa versa)


(defun c:elevator()(setq objects (ssget))(setq elevator (caddr (trans '(0 0 0) 1 0)))(command "change" objects "" "p" "e" elevator "")(princ));;;

Tom Beauford
2013-06-12, 03:15 PM
The wblock command should help. Check out:
http://forums.augi.com/showthread.php?15857-DWG-file-created-via-WBlock-has-different-UCS
Wblock the drawing while in CURRENT ucs, then since the new drawing that will be the World ucs flatten should work.

BlackBox
2013-06-12, 03:30 PM
area51visitor,

The post you responded to is from nine (9) years ago, back in 2004... Also, please edit your post to use [CODE ] Tags (http://forums.augi.com/misc.php?do=bbcode#code).

drawingisfun
2013-06-13, 12:01 AM
Strange, when I looked at it yesterday it was listed with 0 replies lol. Thanks! (and sorry I forgot about the code brackets :)

alanjt
2013-06-13, 03:02 AM
Since this thread is almost a decade old, I'll be the first to derail...how/why do some of you guys have the 'professional member' logo?

drawingisfun
2013-06-13, 04:58 AM
Lol... sorry Alan. Was an honest mistake. I sorted by replies and simply responded to the first one that said 0. I didn't realize that anything around that time appears to say 0 replies, whether they have responses or not. It's difficult to find time to look at every detail when volunteering to help someone for free.

I'm not sure how I have the logo, other than I am a paid member and this is a merged account from one I've had for a considerably longer time. I've in fact had many conversation with you over the last several years, and have been better for seeing your work in swamp, autodesk, here. This is the first time I've seen you jump to this level of patronizing someone though.

BlackBox
2013-06-13, 12:48 PM
Since this thread is almost a decade old, I'll be the first to derail...how/why do some of you guys have the 'professional member' logo?

... A while back (not that long ago), AUGI implemented new tiered memberships (http://www.augi.com/paid-membership-faq), my favorite part of being a Professional Member (http://www.augi.com/augi-professional-membership) ($100), is the FREE Autodesk Developer Network (ADN) Standard membership (http://www.augi.com/adn-membership-offer) ($1400).

BlackBox
2013-06-13, 12:59 PM
Lol... sorry Alan. Was an honest mistake. I sorted by replies and simply responded to the first one that said 0. I didn't realize that anything around that time appears to say 0 replies, whether they have responses or not. It's difficult to find time to look at every detail when volunteering to help someone for free.

I'm not sure how I have the logo, other than I am a paid member and this is a merged account from one I've had for a considerably longer time. I've in fact had many conversation with you over the last several years, and have been better for seeing your work in swamp, autodesk, here. This is the first time I've seen you jump to this level of patronizing someone though.\


Hrmm... Sounds like an alien named bc.

area51visitor, nobody can catch every detail, so try not to take our informing (not patronizing) you to heart... We're all volunteers here, my friend.

I can personally assure you, that Alan's 'near decade' piggyback comment was intended as justification to pose his question in a not-so-new thread, so he wouldn't have to actually abuse the Google to answer his own question (Zing! *looks over to Alan* :p). Just saying.

BlackBox
2013-06-13, 01:07 PM
Getting back on topic....



Unfortunately I don't have time to rewrite the flatten command, but this is one way to adjust objects z to match ucs z (hint trans converts a coordinate from UCS to WCS, or visa versa)



(defun c:elevator ()
(setq objects (ssget))
(setq elevator (caddr (trans '(0 0 0) 1 0)))
(command "change" objects "" "p" "e" elevator "")
(princ)
)



... For your consideration:


(defun c:ELEV ()
(command "._change" pause "" "properties" "elev" (getvar 'elevation) "")
(princ)
)

alanjt
2013-06-13, 01:53 PM
Lol... sorry Alan. Was an honest mistake. I sorted by replies and simply responded to the first one that said 0. I didn't realize that anything around that time appears to say 0 replies, whether they have responses or not. It's difficult to find time to look at every detail when volunteering to help someone for free.
Oh, I wasn't bothered by it and you shouldn't apologize, especially not to the likes of me. You have answered a question that has puzzled me for years. I didn't realize you could sort the list by replies. I keep it sorted by most recent.


I'm not sure how I have the logo, other than I am a paid member and this is a merged account from one I've had for a considerably longer time.
The paid member makes sense. That's likely what it is. Thank you.


This is the first time I've seen you jump to this level of patronizing someone though.
If you felt I was patronizing, I must apologize. I was merely taking advantage of a dead thread and asking a question that has puzzled me. I in no way meant to offend you, and, as you stated, I'm not normally one to act as such. Regardless, I do genuinely apologize for any offense I may have caused. The only reason I commented on it being almost a decade old was just to semi-justify my inquiry and thread derailment.


Edit: apparently I'm too stupid to break up a quote and reply properly.

drawingisfun
2013-06-13, 01:54 PM
Lol... sorry peeps! It was pretty noobish....and thanks for the add Black... I tried 'elevator but I thought it gave me an elevation of zero... i must have missed something. Blackbox you're Renderman right? or no? I've been away a little bit and get all you all seasoned programmers mixed up.

alanjt
2013-06-13, 01:58 PM
... A while back (not that long ago), AUGI implemented new tiered memberships (http://www.augi.com/paid-membership-faq), my favorite part of being a Professional Member (http://www.augi.com/augi-professional-membership) ($100), is the FREE Autodesk Developer Network (ADN) Standard membership (http://www.augi.com/adn-membership-offer) ($1400).
Cool. Thanks for the info.


Hrmm... Sounds like an alien named bc.

area51visitor, nobody can catch every detail, so try not to take our informing (not patronizing) you to heart... We're all volunteers here, my friend.

I can personally assure you, that Alan's 'near decade' piggyback comment was intended as justification to pose his question in a not-so-new thread, so he wouldn't have to actually abuse the Google to answer his own question (Zing! *looks over to Alan* :p). Just saying.How dare you call me out on being lazy! :P

drawingisfun
2013-06-13, 01:58 PM
It's all good XD I'm pretty embarrassed my first post on by merged account was a totally noob lol... something I would do though

alanjt
2013-06-13, 02:03 PM
It's all good XD I'm pretty embarrassed my first post on by merged account was a totally noob lol... something I would do though

So, does this mean I can or can't call you a n00b...merge-n00b?

BlackBox
2013-06-13, 02:09 PM
I can personally assure you, that Alan's 'near decade' piggyback comment was intended as justification to pose his question in a not-so-new thread, so he wouldn't have to actually abuse the Google to answer his own question (Zing! *looks over to Alan* :p). Just saying.



The only reason I commented on it being almost a decade old was just to semi-justify my inquiry and thread derailment.


It appears that I was only semi-correct. :(



Cool. Thanks for the info.


Anytime. You're very welcome, my friend. :beer:



How dare you call me out on being lazy! :P


If you felt I was patronizing, I must apologize. I was merely taking advantage of a question you posed here with no patronization to attempt to put out a flame, err, fire. I in no way meant to offend you, and, as you stated, you're not normally one to act lazy. Regardless, I do genuinely apologize for any offense I may have caused. The only reason I commented on it is to poke fun at you for being away from the forums so long that you missed this little gem (also discussed at TS), and to semi-justify my ending the thread derailment.

alanjt
2013-06-13, 02:12 PM
It appears that I was only semi-correct. :(



Anytime. You're very welcome, my friend. :beer:



If you felt I was patronizing, I must apologize. I was merely taking advantage of a question you posed here with no patronization to attempt to put out a flame, err, fire. I in no way meant to offend you, and, as you stated, you're not normally one to act lazy. Regardless, I do genuinely apologize for any offense I may have caused. The only reason I commented on it is to poke fun at you for being away from the forums so long that you missed this little gem (also discussed at TS), and to semi-justify my ending the thread derailment.

Oh, the derailment has just begun.

My favorite color is black.
My favorite kind of pizza is pepperoni and sausage.
I like to put broccoli and corn on my home-made pizzas.

BlackBox
2013-06-13, 02:14 PM
...and thanks for the add Black... I tried 'elevator but I thought it gave me an elevation of zero... i must have missed something.


In your code:




(defun c:elevator ()
(setq objects (ssget))
(setq elevator (caddr (trans '(0 0 0) 1 0)))
(command "change" objects "" "p" "e" elevator "")
(princ)
)



... You translate a zero elevation, which AFAIK always returns the supplied elevation (only translating the x, y).

Example:


_$ (trans '(0.0 0.0 3.0) 1 0)
(0.0 0.0 3.0)
_$




Blackbox you're Renderman right? or no? I've been away a little bit and get all you all seasoned programmers mixed up.


What is a RenderMan? *not sure*

BlackBox
2013-06-13, 02:29 PM
Oh, the derailment has just begun.

My favorite color is black.
My favorite kind of pizza is pepperoni and sausage.
I like to put broccoli and corn on my home-made pizzas.




... A thing like that.



https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRM3iq8bm3s7Qclx2hD9lfcAndodmqbex9q1z_PRTMmM3H5AMTM

#MadMen