This is the version with sssetfirst: (defun C:SELECTTEXT (/ sset) (sssetfirst nil (setq sset (ssget '((0. If I understand well sbanister want to count how many text objects are selected. Youll need the blocks selected for the next steps. All the blocks on layer 001 abc are added to a new selection set, and the block count is displayed. Specify Layer and choose 001 abc for the Layer value and click OK. In particular, if each of your N polylines will have a different linetype, the use of this version of incr will contribute the time quadratic in N to the total execution time. Oliver's code is forcing user to select text, it is not going to count how many objects are already selected, because he removed sssetfirst. To count all the blocks on a specified layer, follow these steps: Start the QSELECT command. we first write the simplest code which does the job. In developing the incr function we followed the principle of "correctness first, efficiency later" i.e. (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i))))) Now we can use it, (defun c:TEST (/ ss i obj key tbl) Free AutoLISP code snippets that can help you on the way with Visual LISP in. (T key is in the cdr of tbl - keep on searching key is in the car of tbl - increment the count Yes, just create a little function for yourself, (defun incr (key tbl)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |