Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop through Layouts via Lisp

Status
Not open for further replies.

lrfcbabe

Programmer
Jul 19, 2001
108
US
First of all, Thanks to Paul and Scott for there feedbacks on Pauls earlier post "VB.net and AutoCad Programming" (sorry to sidetrack you like that Paul). And I do have a tendency not to do enough error checking in my code. The prob. was the SelectionSet already existed. And now on to my new Autolisp problem. I create a selection set of objects that exitst in multiple layouts. After it runs it says "20 were not found in the current space." Will I need to put the code in a loop to catch all the layouts. Here is the if statement
(if (tblsearch "LAYER" "1")
(progn
(command "-LAYER" "c" "11" "1" "")
(setq sset (ssget "X" '((8 . "1"))))
(if sset (command ".CHANGE" sset "" "p" "c" "11" ""))))
(if (tblsearch "LAYER" "2")
(progn
(command "-LAYER" "c" "13" "2" "")
(setq sset (ssget "X" '((8 . "2"))))
(if sset (command ".CHANGE" sset "" "p" "c" "13" ""))))
);progn
);if

Thanks
 
Also I cannot create this selection set
(setq layoutsset (ssget "X" '((0 . "layout"))))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top