Message 1 of 12
EXTRACT ATTRIBUTE DATA FROM SELECTED BLOCK & CREATE TABLE IN MODEL SPACE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone I am new to Autolisp,
Please guide me on the following code, I have taken the efforts to go through the complete forum for solution but could not understand.
(defun c:CRTP (/ sel SS dxeFile)
(initget 1 "All Select")
(setq sel (strcase (getkword "\Select individual blocks or Select All (S or A): ")))
(if (= sel "SELECT")
(setq SS (ssget '((2 . "xyz123")))
)
(setq SS (ssget "_X" '((2 . "xyz123")))
)
)
; Define the path to your predefined DXE file
(setq dxeFile "C:\\Users\\Desktop\\dsf.dxe") ; Update with the full path to your DXE file
; Check if any blocks were selected
(if (null SS)
(prompt "\nNo blocks selected.")
(progn
; Load the predefined DXE file
(command "-dataextraction" "DATAEXTRACTION" "LOAD" dxeFile)
; Select the specified objects
(command "-dataextraction" "SELECT" SS "")
; Generate the data extraction table
(command "-dataextraction" "EXTRACT" "")
(princ "Data Extraction table created.")
)
)
(princ)
)