Auto Room Dimensions

Auto Room Dimensions

zaid.k3112
Contributor Contributor
10,300 Views
39 Replies
Message 1 of 40

Auto Room Dimensions

zaid.k3112
Contributor
Contributor

Hello, I would like a small lisp in which when I select 2 corners of the room, itll place a text in middle with the room name & room dimensions with the current layer and text style. Itll go like this 

Line 1: Bedroom

Line 2: 3.05 x 3.30 M

Line 3: 10' x 10'9"

It should be length x breadth always.  All as middle center justification. I have found a few lisp but it just has feet inches and not both dimensions. Itll save a lot of my time if someone could do it. Thanks & Regards

Capture.JPG

0 Likes
Accepted solutions (1)
10,301 Views
39 Replies
  • Lisp
Replies (39)
Message 21 of 40

Anonymous
Not applicable
Can you please update for me 10' to 10'-0"
Thanks in advance
0 Likes
Message 22 of 40

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
Can you please update for me 10' to 10'-0"
Thanks in advance

Read about the DIMZIN System Variable.  You can set that to dictate whether Zero INnches is included in such text strings -- that's exactly what the System Variable is named for.

Kent Cooper, AIA
0 Likes
Message 23 of 40

Anonymous
Not applicable

How to get room sizes in mt & feet-inch while working in mm?

Kindly Help

0 Likes
Message 24 of 40

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

How to get room sizes in mt & feet-inch while working in mm?

Kindly Help


Try changing this:

(defun _Imperial (v) (rtos (cvunit v "meter" "inch") 4 0))

to this:

(defun _Imperial (v) (rtos (cvunit v "millimeter" "inch") 4 0))

 

and if you still want the metric size in meters, this:

	(setq str (strcat (car txFont) Roomname (cadr txFont)
			   (rtos h 2 2) " x " (rtos v 2 2) "\\P"
			   (_Imperial h) " x " (_Imperial v) (caddr txFont)))

to this:

	(setq str (strcat (car txFont) Roomname (cadr txFont)
			   (rtos (/ h 1000) 2 2) " x " (rtos (/ v 1000) 2 2) "\\P"
			   (_Imperial h) " x " (_Imperial v) (caddr txFont)))
Kent Cooper, AIA
Message 25 of 40

Anonymous
Not applicable
Thank You so much sir, it's working.
0 Likes
Message 26 of 40

zaid.k3112
Contributor
Contributor
in the lisp itself there might be units. check it
Message 27 of 40

chetankpatel1984
Explorer
Explorer

Can you please update lisp with multi redio button

0 Likes
Message 28 of 40

Sea-Haven
Mentor
Mentor

The multi lisps by me are for input not output like draw text.

0 Likes
Message 29 of 40

ashikahmed1
Community Visitor
Community Visitor

HELLO,, IS WORKS FOR ME AS WELL. BUT INEED 1000 X 1000 , NOT 1000.00 . AFTER THE (.) .WHAT SHOULD I DO. ANY CHANGS IN THE CODE LINE. PLEASE REPLY .IT URGENT. @pbejse @zaid.k3112 @Sea-Haven @

0 Likes
Message 30 of 40

Kent1Cooper
Consultant
Consultant

@ashikahmed1 wrote:

... INEED 1000 X 1000 , NOT 1000.00 . AFTER THE (.) .WHAT SHOULD I DO. ...


Read about the arguments to the (rtos) function >here<.  That will tell you why you should try changing this part:

(rtos h 2 2) " x " (rtos v 2 2)

to this:

(rtos h 2 0) " x " (rtos v 2 0)

 

Kent Cooper, AIA
0 Likes
Message 31 of 40

ashikahmed1
Community Visitor
Community Visitor

WHAT TO DO IF THE ROOM IS NOT A RECTANGLE. I'VE ATTACHED A SS FOR YOUR REFERENCE, @Kent1Cooper @zaid.k3112 @Sea-Haven 

0 Likes
Message 32 of 40

Kent1Cooper
Consultant
Consultant

@ashikahmed1 wrote:

WHAT TO DO IF THE ROOM IS NOT A RECTANGLE. .... 


What criteria would you use for which two distances should be shown in the text reporting?  If you can get what you want as in the original message, "...when I select 2 corners of the room..." you can still do that with the farthest-apart corners [or any corners you choose].  But of course, a simple A x B two-length report would be misleading, since the area of the room isn't the product of the two distances shown, as in a rectangular room.  So that just may not be the right way to say it at all.  What if it's not an L as in your image, but has curved walls or something?  One size does not fit all.

Kent Cooper, AIA
Message 33 of 40

pranjal_mahe
Community Visitor
Community Visitor

Hi, firstly thank you so much for the lisp command list. Sir I have a problem, when I execute this command the dimensions I get are like : 3350.00 x 4570.00 & 10990'-10" x 14993'-5" thats in MM and feet should be 11'0" x 15'0". Is there a factor that needs to be added to the lisp that will help attain that figure. I want in meters and in feet and inches. 

thank you so much in advance. 

 

0 Likes
Message 34 of 40

zaid.k3112
Contributor
Contributor

The Lisp itself gives me 3.300 x 3.050 in meters & 10'10'' x 10' when I initiate it. Please check with your drawing. The lisp works fine for me.

0 Likes
Message 35 of 40

pranjal_mahe
Community Visitor
Community Visitor

is it because I am working in mm? 

0 Likes
Message 36 of 40

zaid.k3112
Contributor
Contributor

That may be the problem. Can you share your dwg file? I have been using this lisp everyday with no problem.

0 Likes
Message 37 of 40

pranjal_mahe
Community Visitor
Community Visitor

attached🙏

0 Likes
Message 38 of 40

pranjal_mahe
Community Visitor
Community Visitor
Im using a mac... if that could be contributing to the issue
0 Likes
Message 39 of 40

amardesai2009
Observer
Observer

sir,

auto room dimension only feet

and only meter 

bedroom

3.05x3.05

 

bedroom

10'0"x10'0"

0 Likes
Message 40 of 40

Kent1Cooper
Consultant
Consultant

@amardesai2009 wrote:

.... auto room dimension only feet  and only meter  ....


I don't think that was meant to be in Reply to the OP, which probably means you used the "Reply to the topic..." slot at the bottom of the Messages.  Everything entered there comes through as being in Reply to Message 1 and its author.  Did you mean it to be in Reply to the accepted-solution Message?  Always use the REPLY button at lower right in the Message you are Replying to.

 

And are you asking for a version of the routine that puts in Dimensions in only one format, and another version using only the other format, instead of both formats in one?

Kent Cooper, AIA
0 Likes