Jump to content

Room Dimensioning Lisp requesting


structo

Recommended Posts

Hi All Friends,

 

i need one lisp for auto room dimensions by following rules:

 

1)select first top left corner point of the room

2)select bottom right corner point of the room

 

3)choose room description text from list

 

a) choose different options from predefined options. if choose "1" option then text as "C.BOX Room"

b)if choose "2", then room Name placed as "Gen.Room"

c) if Choose "3", then room name as "Waiting.Room"

d)if choose "4", then room name as "Conference.Hall"

e)if Choose "5", then Room name as "Kitchen.Room"

 

4) then develop room Dimension as (for Example, i choose "4"th option from command prompt),

 

Conference.Hall

28'0"x25'4½"

 

please see sample drawing.

 

Thanks.

room dimension.jpg

Room dimension.dwg

Link to comment
Share on other sites

  • Replies 31
  • Created
  • Last Reply

Top Posters In This Topic

  • structo

    15

  • maratovich

    10

  • AP Kumar

    2

  • ReMark

    1

Top Posters In This Topic

Posted Images

Looks like you have some redundancy in the above image. You have the dimensions themselves and you call them out under the room name. Wouldn't one or the other suffice?

Link to comment
Share on other sites

Looks like you have some redundancy in the above image. You have the dimensions themselves and you call them out under the room name. Wouldn't one or the other suffice?

 

thank you friend for responding,

 

yes i need suffice of predefined room names by code. i need to automate several blocks or rooms by selecting two corners of the room or block.

 

Thank you.

Link to comment
Share on other sites

thank you friend for responding,

 

yes i need suffice of predefined room names by code. i need to automate several blocks or rooms by selecting two corners of the room or block.

 

Thank you.

 

almost similar old thread

you can tweak it yourself, many active members here will guide you

Link to comment
Share on other sites

My shot at this:

(defun C:test ;| credits to: Lee Mac |; ( / Lst p1 p2 choice )
(setq Lst
	'(
		("1" . "C.BOX Room")
		("2" . "Gen.Room")
		("3" . "Waiting.Room")
		("4" . "Conference.Hall")
		("5" . "Kitchen.Room")
	)
); setq

(if
	(and
		(setq p1 (getpoint "\nSpecify first point: "))
		(setq p2 (getcorner p1 "\nSpecify second point: "))
		(not (initget 1 (apply 'strcat (mapcar '(lambda (x) (strcat x " ")) (mapcar 'car Lst)))))
		(setq choice (getkword (strcat "\nSpecify option [" (vl-string-right-trim "/" (apply 'strcat (mapcar '(lambda (x) (strcat x "/")) (mapcar 'car Lst)))) "]: ")))
		(setq 
			p1 (trans p1 1 0)
			p2 (trans p2 1 0)
		)
	)	
	(entmakex 
		(list 
			(cons 0 "MTEXT")         
			(cons 100 "AcDbEntity")
			(cons 100 "AcDbMText")
			(cons 10 (apply 'mapcar (cons '(lambda (a b) (/ (+ a b) 2.)) (list p1 p2)))) 
			(cons 1 
				(strcat
					(cdr (assoc choice Lst))
					"\\P" (rtos (abs (apply '- (mapcar 'car (list p1 p2)))) 2 2) "x" (rtos (abs (apply '- (mapcar 'cadr (list p1 p2)))) 2 2)
				)
			)
			(cons 71 5)
		)
	)
)
(princ)
)

 

Sorry we don't use imperial units, so someone else will have to fix that for you.

Link to comment
Share on other sites

My shot at this:

 

Sorry we don't use imperial units, so someone else will have to fix that for you.

 

wow, good shot Grr friend and Lee Mac friend,

 

i will wait for Feet and inches units ( imperial units) which is mentioned in sample drawing format.

 

Thank you.

Link to comment
Share on other sites

almost similar old thread

you can tweak it yourself, many active members here will guide you

 

hi hanh,

 

i saw your link. i need some tweaks from that thread.

 

1)please add room name description option.

2)text was developed as (For example) 12', instead of 12'-0"

 

Thank you.

Link to comment
Share on other sites

Use this macro:

Dear Marat friend,

your macro is great working. especially GUI is awesome. my final request is if any possibilities, please tweak half inch display text format as shown in image.

 

Thank you for helping.

Half inch.JPG

Edited by structo
Link to comment
Share on other sites

New version:

 

 

Excuse me, but did not immediately understand.

replace the 1 \ 2 on the vertical division - it is long and difficult.

possible to do, but ...

I have a lot of work.

 

hi friend,

 

thank you for valuable reply. i apologies for inconvenience caused. here i have attached sample out put format. your previous version is enough (post#10). i have requested only vertical format (stacked format, it is showing option at medit window, by manual editing). please tweak when you have free time only.

 

Thank you for support.

Half inch format.JPG

Link to comment
Share on other sites

See version 3

 

Thank you for yours valuable modification. some gap is formed as mentioned in picture. please modify.

 

sorry for asking modifications.

 

thank you.

Half inch format.JPG

Link to comment
Share on other sites

Again sincere thanks to you friend,

 

still facing space issue by out put text, minor error. here i have attached image. please have a look.

 

Thank you for great contribution.

Half inch format without space.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...