Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun C:lM (/ searchString basept ss n totalTextEntities)
; Set the search string to "muthu"
(setq searchString "muthu")
; Prompt the user to enter the base point
(setq basept (getpoint "\nEnter base point for marking Lines: "))
; Initialize a variable to count the total number of text entities found
(setq totalTextEntities 0)
; Iterate through the layers in the active document
(vlax-for lay (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
; Check if the layer name matches the search string using wildcards
(if (wcmatch (vla-get-name lay) (strcat "*" searchString))
(progn
; Get the selection set of text entities on the current layer
(if (setq ss (ssget "_X" (list (cons 8 (vla-get-name lay)))))
(progn
; Process each text entity found on the current layer
(setq n (sslength ss))
(repeat n
(entmake
(list
'(0 . "LINE")
(cons 10 basept)
(cons 11 (cdr (assoc 10 (entget (ssname ss (setq n (1- n))))))
)
)
)
; Increment the total count of text entities found
(setq totalTextEntities (+ totalTextEntities (sslength ss)))
)
)
)
)
)
; Display the total count of text entities found
(alert (strcat "Total text entities found: " (itoa totalTextEntities)))
(princ)
).i want serach layer name contain muthu string count and find mark with line error is malformed list on input
how to solve this problem
Solved! Go to Solution.