- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Autodesk group members, specially all programmers i need your help on this topic (it will be great if any one can help me on same)
i am looking to create a LISP for my project need for AUTOCAD 2017.
I want to create a Rectangle in specific layer with customized command then i want to give L & W to that rectangle on run time, so that after completion/in mid of command i will get rectangle of required size, then once rectangle is created i want to get a popup message that autocad shall ask me to give Name of rectangle which i want to place by default in the center of rectangle created.
i want to do this for different rectangles to be created.
i created customized command to create specific rectangle layer current followed by i created rectangle using below code at the moment. I am not in touch with LISP writing for 10 yrs & forgot most of the things and my previous codes are not working in new version. Please can anyone help me on same. it will be a great help from you, thanking you in advance for your kind support on same. i need it urgently.
(defun _SetCLayer (layerName)
(if (tblsearch "layer" layerName)
(setvar 'clayer layerName)
(prompt
(strcat "\n** Layer \"" layerName "\" not found ** ")
)
)
(princ)
)
(defun c:ACDB () (_SetCLayer "AC_DB") (command "RECTANG" "")) - in this autocad is also giving some violations.
(defun c:ACON () (_SetCLayer "AIR_CON") (command "RECTANG"))
(defun c:FBAT () (_SetCLayer "BATTERY") (command "RECTANG"))
(defun c:FBEN () (_SetCLayer "BUILDING_ENVELOPE") (command "RECTANG"))
(defun c:FCAB () (_SetCLayer "CABINET") (command "RECTANG"))
(defun c:DCDB () (_SetCLayer "DC_DB") (command "RECTANG"))
(defun c:FDEF () (_SetCLayer "Defpoints") (command "RECTANG"))
(defun c:FPDI () (_SetCLayer "DIMENSIONS") (command "RECTANG"))
(defun c:FPDR () (_SetCLayer "DOORS") (command "RECTANG"))
(defun C:FFED () (_SetCLayer "FEEDER") (command "RECTANG"))
(defun c:FPLD () (_SetCLayer "FLOOR_LEGEND") (command "RECTANG"))
(defun c:IMGI () (_SetCLayer "Image") (command "RECTANG"))
(defun c:FOTR () (_SetCLayer "OTHER") (command "RECTANG"))
(defun c:FRAK () (_SetCLayer "RACK") (command "RECTANG"))
(defun c:FREF () (_SetCLayer "RECTIFIER") (command "RECTANG"))
(defun c:FTEX () (_SetCLayer "TEXT") (command "RECTANG"))
)
In past i used below command to give text, which is now not working
(defun C:ACDBT ()
(setq bldg_no (strcase (getstring "/n Type the ACDB NO: ")))
(setq bldgno (strcat "ACDB" bldg_no))
(polbldgno)
(command "clayer" "AC_DB" "" "text" fspt txtht angpts bldgno "")
)
So finally my requirement is for floor plans i have to create:
1. Rectangle in current specific layer where i should get pop-up to give L & W.
2. Text in the center of that rectangle "with pop up to enter only number after concatenated Specific text"
3. After creation of all rectangles i want to give dimension to all rectangles in on go by selecting them.
Solved! Go to Solution.