Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AEC Window Block - how to extract ht width and head height

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
johnw
634 Views, 4 Replies

AEC Window Block - how to extract ht width and head height

When I go to extract DXF code info out of an AEC Window block (primarily looking for window width, height, and head ht codes) I get the following information which is very basic. is there a way to drill down further to get more data on the information I'm looking for?

 

(setq ed (entget ( car (entsel))))

Select object: ((-1 . <Entity name: 7fffee1c020>) (0 . "AEC_WINDOW") (330 . <Entity name: 7ffff1e09f0>) (5 . "64CA") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "A-Glaz-F1"))

 

Thanks,

 

John W

4 REPLIES 4
Message 2 of 5
jsowinski
in reply to: johnw

John-
This should get you a little more information on an object. It will convert your entsel to a vla-object. Hope that helps.

(defun c:info ( / ent obj)
(setq ent (entsel "Select entity to get object data&colon; "))
(setq obj (vlax-ename->vla-object (car ent)))
(vlax-dump-object obj)
(textscr)
)
Message 3 of 5
johnw
in reply to: jsowinski

Thanks! Instead of just listing data in text format, can you revise your code to list in autolisp format so I can use for other lisp routines I wish to create vs. it's own command. I hope this makes sense. Ultimately I want to extract width, ht, and head ht so I can run my label command to find all "aec windows" and at each insertion point lable a text string of the size based on the data I extract then label the HD AT 6'-8" below from the data I extract as well. Your list is awesome but I wouldn't know how to get this information I'm mentioning and assign it a variable. I.E. Setq winht, Setq WinWidth, Setq Hdht, etc.
Message 4 of 5
jsowinski
in reply to: johnw

I'm glad that you're able to find the information you want in the text output. If I understand what your asking I added some variables to the routine to get the head height, height and width. This will get the numeric values from that list. Let me know if that works for you or if you need anything else from that list. I added the princ line so you could see each value. You don't need to use that for your code if you don't want it.

 

(defun c:info ( / ent obj HeadHeight Height Width)
 (setq ent (entsel "Select entity to get object data&colon; "))
 (setq obj (vlax-ename->vla-object (car ent)))

 (setq HeadHeight (vlax-get obj 'HeadHeight))
 (setq Height (vlax-get obj 'Height))
 (setq Width (vlax-get obj 'Width))

 (princ (strcat "\nHeadHeight: " (vl-princ-to-string HeadHeight) "\nHeight: " (vl-princ-to-string Height) "\nWidth: " (vl-princ-to-string Width) ))
 (princ)
)

 

Message 5 of 5
johnw
in reply to: jsowinski

Awesome! The 3 variables you created are exactly what I need. Thanks for your help! Please let me know if you write code for hire. I am somewhat of a novice and need help with more complicated routines I'm trying to write. If you're interested please message me so I know how I can reach you outside of this forum.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost