This code creates a command called DRHT that will check all of the Doors in a drawing file and change the height of those whose style name is Bifold - Single to 62.0. You will need to substitute the name of your HVAC closet Door Style.
(defun C:DRHT ( ; No arguments.
/
iCount ; Loop counter [integer].
iMax ; Total number of Doors in file [integer].
iProc ; Number of Doors processed [integer].
objDoor ; Door object being processed.
ss1 ; All Doors in the file [selection set].
sStyleName ; Style name of Door being processed [string].
) ;_ End arguments and local variables.
(setq ss1 (ssget "_X" '((0 . "AEC_DOOR"))))
(cond
((not ss1) ; No Doors in drawing.
(alert "Drawing file has no Door objects.\nNothing to do!")
) ;_ End condition A1.
(T ; Else, continue.
(setq iMax (sslength ss1)
iCount 0
iProc 0
) ;_ End setq.
(while (< iCount iMax)
(setq objDoor (vlax-ename->vla-object (ssname ss1 iCount))
sStyleName (vlax-get-property objDoor 'StyleName)
) ;_ End setq.
(if (= sStyleName "Bifold - Single")
(progn
(vlax-put-property objDoor 'Height 62.0)
(setq iProc (1+ iProc))
) ;_ End progn.
) ;_ End if.
(setq icount (1+ icount))
) ;_ End while.
) ;_ End condition A2.
) ;_ End cond A.
(prompt
(strcat
"\nDRHT function completed: "
(itoa iProc)
" Door(s) of "
(itoa iCount)
" total Door(s) processed. "
) ;_ End strcat.
) ;_ End prompt.
(prin1)
) ;_ End C:DRHT.
David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
