Jump to content

Selection set from list


Accoes

Recommended Posts

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"))

Link to comment
Share on other sites

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"))))

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 ?.

Link to comment
Share on other sites

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")))

Link to comment
Share on other sites

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"))))

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Sorry ,a little slow here.Do you have an example.

 

Went for a walk,I'll take a crack at it.Think I understand

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...