Accoes Posted May 20, 2010 Share Posted May 20, 2010 I'm trying to get a selection set from a list.The selection I would like is assoc 301 from this.I have a start I think,but no go. (setq aa (entget "x" '((0 . "MAPS_SOLID" (301 . "on"))) Select object: ((-1 . <Entity name: 7ffff808470>) (0 . "MAPS_SOLID") (330 . <Entity name: 7ffff803e50>) (5 . "607") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "M-SALP-GVDU-REC") (8 . "M-SALP-GVDU-REC") (300 . "TRANS HOLE") (300 . "None") (300 . "Not Set") (300 . "Galvanized") (300 . "24") (300 . "24") (300 . "24 (inch)") (300 . "0") (300 . "") (300 . "") (306 . "On") (305 . "On") (301 . "On")) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 20, 2010 Share Posted May 20, 2010 Look into the ssget function. Quote Link to comment Share on other sites More sharing options...
Accoes Posted May 20, 2010 Author Share Posted May 20, 2010 (ssget "x" '((0 . "MAPS_SOLID" )(301 . "on"))) I had tried that before.Will keep looking Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 20, 2010 Share Posted May 20, 2010 That should be correct - providing you have the correct data in the Filter list. Quote Link to comment Share on other sites More sharing options...
Accoes Posted May 20, 2010 Author Share Posted May 20, 2010 That second code field up top was a (entget(car(entsel))).It's returning nil and not highlighting the object This will create the selection but not filter enough (sssetfirst nil (ssget "_X" '((0 . "MAPS_SOLID")))) This for some reason will not (sssetfirst nil (ssget "_X" '((0 . "MAPS_SOLID")(301."on")))) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 20, 2010 Share Posted May 20, 2010 How about this? (sssetfirst nil (ssget "_X" '((0 . "MAPS_SOLID")(301 . "On")))) Quote Link to comment Share on other sites More sharing options...
Accoes Posted May 20, 2010 Author Share Posted May 20, 2010 Bingo....That space was causing the headache. Thanks for the help.I have another question and tried to look it up but could not figure away to put it in a search.The apostrophe after the "_x".What does that tell it? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 20, 2010 Share Posted May 20, 2010 Explanation of the Apostrophe: http://www.cadtutor.net/forum/showpost.php?p=258390&postcount=20 Quote Link to comment Share on other sites More sharing options...
Accoes Posted May 21, 2010 Author Share Posted May 21, 2010 Just to clarify,it was not a space but a lower case string. Quote Link to comment Share on other sites More sharing options...
Accoes Posted May 28, 2010 Author Share Posted May 28, 2010 In the first post in the second code section ,I would like to filter with one of the associate 300 series.Is it posible to choose one when there are several or do you have to parse them out? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 28, 2010 Share Posted May 28, 2010 You probably could filter by it, but I'd be more inclined to manually filter the resultant SelectionSet. Quote Link to comment Share on other sites More sharing options...
Accoes Posted May 28, 2010 Author Share Posted May 28, 2010 Ok very good Two more questions...I think When I entget a 3dsolid I get this jibberish +->687+r<*-): {rn rn {rn klqlmfkhhffgkfmjik ikqhimofifkfmfjnff li rn o o V V |") (1 . "<0:;8: {rn rn {rn {ln {kl {ll {im -:-,:; {nl {rn |") (1 . "):-+:' {rn rn {rn {jk n {hf |") (1 . ",+->687+r<*-): {rn rn {rn klqlmfkhhffgkfmjik klqonnjlhfggkllghm li n o o V V |") (1 . ":;8: {rn rn {rn {li rng {jn ng {ll {go 90-(>-; _h *1410(1 |") (1 . ":;8: {rn rn {rn {lh rng {jo ng {lk {gn 90-(>-; _h *1410(1 |") (1 . "/061+ {rn rn {rn jjqonimjkgilhhgmnj klqonnjlhfggkllghm li |") (1 . "/061+ {rn rn {rn jjqonimjkgilhhgmnj ikqhimofifkfmfjnff li |") (1 . "/3>1:r,*-9><: {rn rn {rn jjqonimjkgilhhgmnj jlqggignhkiggikjlj ng rn o o o o n 90-(>-;@) V V V V |") (1 . "<0:;8: {rn rn {rn {kk {km {ki {hn -:-,:; {mn {rn |") (1 . ":;8: {rn rn {rn {jh rng {hl ng {ji {gm 90-(>-; _h *1410(1 |") (1 . "):-+:' {rn rn {rn {hn o {gl |") (1 . ",+->687+r<*-): {rn rn {rn I take it this this might be the .net stuff? Not sure...Glad I started with the Map stuff first. Second contingent on that previous code....Can you filter. two different items ,say a AcDb3dSolid and a Mapsolid in the same selection filter ?. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 28, 2010 Share Posted May 28, 2010 Yes you can have many filters in the SelectionSet, this might be worth a read: http://www.afralisp.net/autolisp/tutorials/selection-sets.php http://www.afralisp.net/autolisp/tutorials/selection-set-filters.php Quote Link to comment Share on other sites More sharing options...
Accoes Posted June 1, 2010 Author Share Posted June 1, 2010 Thank you very much (-4 . " Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 1, 2010 Share Posted June 1, 2010 Bear in mind that the ssget filter strings accept all wildcards, so OR is sometimes not necessary, example: (ssget "_X" '((0 . "TEXT,MTEXT"))) Or (ssget "_X" '((0 . "*LINE"))) Quote Link to comment Share on other sites More sharing options...
Accoes Posted June 2, 2010 Author Share Posted June 2, 2010 I have stumbled here.I'm trying to get past the block to find out if it's a 3dsolid.I have tried both of these and several other ways.Need a little push (sssetfirst nil (ssget "_X" '((100 . "AcDbBlockReference")(0 . "3DSOLID")))) (sssetfirst nil (ssget "_X" '((-4 . "<and")(100 . "AcDbBlockReference")(0 . "3DSOLID")(-4 . ">and")))) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 2, 2010 Share Posted June 2, 2010 You cannot filter nested items in a SelectionSet, you will need to filter as much as you can on the top level, and then iterate through the block definition within the block table to check what is contained within. Quote Link to comment Share on other sites More sharing options...
Accoes Posted June 2, 2010 Author Share Posted June 2, 2010 Sorry ,a little slow here.Do you have an example. Went for a walk,I'll take a crack at it.Think I understand Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 2, 2010 Share Posted June 2, 2010 A nudge in the right direction: [i][color=#990099];; GetSubObjects[/color][/i] [i][color=#990099];; blk = Block Entity Name[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] GetSubObjects [b][color=RED]([/color][/b] blk [b][color=BLUE]/[/color][/b] foo [b][color=RED])[/color][/b] [i][color=#990099];; © Lee Mac ~ 02.06.10[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] foo [b][color=RED]([/color][/b] ent [b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ent [b][color=RED]([/color][/b][b][color=BLUE]entnext[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] ent [b][color=RED]([/color][/b]foo ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] blk [b][color=RED]([/color][/b][b][color=BLUE]tblobjname[/color][/b] [b][color=#a52a2a]"BLOCK"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]2[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] blk[b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED]([/color][/b]foo blk[b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.