Hello,
I'm trying to find the quantities of blocks on drawing. I used "quick select" command - select by Block Reference. My blocks have some customer’s attributes (for example type of block) which I couldn't find on block reference list. Is any solution to find the quantities of blocks by Type? Please find PDF attachment for snapshots….
Hi, I can't remember if LT has the FIND command, but if it does you can possibly use that you get your count. First use QSELECT to select your block name. Then with the blocks selected, use the FIND command. Put in the the attribute you want to find and replace with the same attribute. You will get a message saying how many were found and 0 changed. Hope this helps.
Wonder if you could one click Macro your way into that?
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
You'd need command-line versions of both QSELECT and FIND...and I don't think they exist.
Hi Charles, try this one out, ^c^c_.selectsimilar //_.find (change the forward slashes to back slashes, the site kept telling invalid HTML)
I used SELECTSIMILAR instead of QSELECT because it's a little quicker.
In the Rich Text menu in this dialog there is a Clipboard with a C on it.
That should allow you to put code in this space with the slashes the correct way.
^c^c_.selectsimilar \\_.find
Did you mean to have the space after similar?
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
Yes, that's the way I put it in and it worked. I'm not real familar with macros but reading the help, it said that a space was the same as spacebar. Of course it also says that you can't have a macro that accepts more than one input but it worked with the two backslashes.
A macro typically resumes after one user input, such as a single point location. Therefore, you cannot construct a macro that accepts a variable number of inputs (as in object selection) and then continues. However, an exception is made for the SELECT command; a backslash (\) suspends the command until object selection has been completed.
Playing around with it a little more, I replaced the second backslash with a space and it worked without having to hit the spacebar after selecting the block. ^c^c_.selectsimilar \ _.find
For future macros, semi-colons also function as space/enter, and they're a lot easier to count.
^c^c_.selectsimilar;\ _.find;
Also, "variable number of inputs" is not the same as "more than one input" -- what it means is that you can only pick one object/selection at a time -- you can't keep clicking to select more objects unless you put in multiple backslashes...but then you have to keep clicking as many times as you're prompted.
semi-colon instead of spaces is the 'pro' way to code macros and alot easier to count how many <enter> you have.
If you want total flexibility in selection (one or many) without pre-counting your clicks, explore starting your macro with SELECT command then using PREVIOUS in your command after that.
Hope the OP is willing to try your FIND tip this way.
I asked because sometimes the Forum here will add a space to a Macro or piece of code that should not be there.
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘