Jump to content

Qselect


dhl

Recommended Posts

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • dhl

    12

  • ronjonp

    10

  • Shawndoe

    3

  • alanjt

    2

Top Posters In This Topic

Posted Images

ssget with a filter would be used instead of qselect. Example...this will select all circles in a drawing:

(sssetfirst nil (ssget "_x" '((0 . "circle"))))

Link to comment
Share on other sites

the problem is that I cant extract the data I'm looking for through filters. Through qselect, however, I can, which is kind of strange

Well, QSelect is a little more sophisticated than the use of ssget. Could you give a little more information to this secret project? We might be able to assist. :wink:

Link to comment
Share on other sites

it's not really a secret :)

 

I tried to attach a dwg file containing the objects for which I use qselect with, but there seems to be a limit on the file size?

 

how do I attach a file?

Link to comment
Share on other sites

Hi,

 

What object types are you trying to select. I have not seen any selection set that could be generated by qselect that can't be done with a proper ssget filter. That's the reason there is no command line version.

 

Basically qselect just constructs an ssget filter and executes it on everything in the drawing, or a given selection set depending on the flag. I have found that the more complex the selection set you are trying to build is, the more likely qselect is to screw up.

 

Have a good one.

Shawndoe

Link to comment
Share on other sites

Hi,

 

What object types are you trying to select. I have not seen any selection set that could be generated by qselect that can't be done with a proper ssget filter. That's the reason there is no command line version.

 

Basically qselect just constructs an ssget filter and executes it on everything in the drawing, or a given selection set depending on the flag. I have found that the more complex the selection set you are trying to build is, the more likely qselect is to screw up.

 

Have a good one.

Shawndoe

 

Totally agree ... ssget with the correct filter can grab just about anything. 8)

Link to comment
Share on other sites

Hi,

 

What object types are you trying to select. I have not seen any selection set that could be generated by qselect that can't be done with a proper ssget filter. That's the reason there is no command line version.

 

Basically qselect just constructs an ssget filter and executes it on everything in the drawing, or a given selection set depending on the flag. I have found that the more complex the selection set you are trying to build is, the more likely qselect is to screw up.

 

Have a good one.

Shawndoe

 

 

Try using ssget to filter by specific Civil 3D object properties, which do not have a dxf code. That's what I was really implying by my comment about QSelect being more sophisticated than ssget.

Link to comment
Share on other sites

Hi,

 

I don't have Civil 3D so I can't speak to that. You might try exporting the drawing as a DXF and see what it does with those properties. That data has to be kept someplace.

 

Have a good one.

Shawndoe

Link to comment
Share on other sites

here's a file attached with a mep device for which I can use qselect and choose according to device properties, but I cannot create a similar ssget filter.

 

If anyone can create a ssget filter to grab using device properties such as 'name' or 'elevation' or whatever, a cyber beer is up for grabs 8)

Drawing2.dwg

Link to comment
Share on other sites

here's a file attached with a mep device for which I can use qselect and choose according to device properties, but I cannot create a similar ssget filter.

 

If anyone can create a ssget filter to grab using device properties such as 'name' or 'elevation' or whatever, a cyber beer is up for grabs 8)

 

scratch 'elevation' that's dxf code 40, but 'name' is still a mystery (in this case the name is '14W')

Link to comment
Share on other sites

scratch 'elevation' that's dxf code 40, but 'name' is still a mystery (in this case the name is '14W')

 

Well it looks like the 14W is a "AECB_DEVICE_STYLE" name. I do not have other devices with different styles to test the filter...so let me know if this works :)

 

 

(if (setq dic (cdr (cadr (member '(3 . "AECB_DEVICE_STYLES") (entget (namedobjdict))))))
 (if (setq dic (cdr (cadr (member '(3 . "14W") (entget dic)))))
   (if    (setq ss (ssget "_x" (list (cons 0 "AECB_DEVICE"))))
     (vl-remove-if-not
   '(lambda (x) (vl-position (cons 341 dic) (entget x)))
   (mapcar 'cadr (ssnamex ss))
     )
   )
 )
)

Link to comment
Share on other sites

I don't think it works, at least I can't get it to, but I'd very much like an explanation to your code cause I can't fully follow it.

 

I've attached another device with a different style name if you feel like trying.

Drawing3.dwg

Link to comment
Share on other sites

I don't think it works, at least I can't get it to, but I'd very much like an explanation to your code cause I can't fully follow it.

 

I've attached another device with a different style name if you feel like trying.

 

I updated the code above...give it a try now. It should return a list of those blocks (not a ss).

 

What questions do you have?

Link to comment
Share on other sites

I updated the code above...give it a try now. It should return a list of those blocks (not a ss).

 

What questions do you have?

 

It seems to work. Great job! and thanks!

 

But I'm not quite sure of how it works, would mind terribly walking through your code step by step, line by line?

 

How would I for instance use count the number of objects filtered,through sslength?

Link to comment
Share on other sites

It seems to work. Great job! and thanks!

 

But I'm not quite sure of how it works, would mind terribly walking through your code step by step, line by line?

 

How would I for instance use count the number of objects filtered,through sslength?

 

To get the total items of a list use (length ss) instead of sslength.

 

I found the "14W" by scouring the dxf data in AutoCAD's Vlide editor. That's how I would suggest looking deeper into these objects if necessary. Any code that contains an ename, you can perform an entget on and see more nested data.

 

Here's a little example:

VLIDE.jpg

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