Jump to content

Recommended Posts

Posted (edited)

This is probably a long shot - but is there a way to do a block count (bcount) so that it will include any attributes that the block has in it as well?

I realise that there is data extraction but i am looking for something a little less clunky than a full data extraction.

A long-shot I realise, but would be super useful.

 

Thanks!

 

EDIT-

AutoCAD 2011

Edited by camel_racer
Posted

Maybe make a template for your data extraction, to filter out what you need?

Other than that, i came across a lot of posts on this site, about block counting and att extraction.

Maybe if you explain what you want from this attributes or blocks, people could assit you even better.

 

 

SB

Posted

This is what I use for attribute extraction. It returns a list of the block attributes, and you could just wrap it in a (length) to figure out how many there are.

(defun blkAtts(ent / e)
 (if (= -1 (vlax-get (setq e (vlax-ename->vla-object ent)) 'hasattributes)) (reverse (mapcar 'vlax-vla-object->ename (vlax-invoke e 'GetAttributes))))
 )

Posted

I have a VBA routine that does other things but which also pops up a window where all blocks with attributes in the drawing are listed together with their attribute tags, but it doesn't return a count of the blocks or the content of the attributes. Is that the kind of thing you are looking for?

Posted

hey guys.. sorry for the super late reply... didnt wanna be one of those guys who gets his answers & dissapears... so thanks heaps for the feedback.

 

I will try out that Freerefill.

 

Just to explain a little more what I am trying to achieve...

We have a system at work which uses hundreds of different (stock) parts to build a structure then custom parts to create the infills or cladding to go on that structure.

 

All the stock parts have booking codes assigned to them as attributes and all the infills / cladding will have attributes such as material, finish, width, height, etc.

 

Because there will always be different blocks in each drawing setting up a template will not work.

 

My aim is to reduce the human error in the bill of material process so that information will not be missed with the jumble of blocks that come up in our data extractions (such as "arc", "rotated dimension" and dozens of others).

 

The idea being that I select the blocks in a drawing (like a "bcount" or lee macs "count") and when I hit enter it will give me a table which will include any attributes those blocks contain.

 

Sorry for the essay.

 

Thanks again guys - always so helpful!

Posted

So, by that, you would need an attribute itemization of each individual block, regardless of how many instance of a block exist in the drawing - since each attributed block instance might have different attribute values. Correct?

 

eg.

Block1 - att1value att2value att3value

Block1 - att1value att2value att3value

Block2 - att1value att2value att3value

Posted

Alan, yes, I'd like to see that also. Just what is needed for pipe / material / length work.

Steve

Posted
So, by that, you would need an attribute itemization of each individual block, regardless of how many instance of a block exist in the drawing - since each attributed block instance might have different attribute values. Correct?

 

eg.

Block1 - att1value att2value att3value

Block1 - att1value att2value att3value

Block2 - att1value att2value att3value

 

Yeah that would be fine if they came through individually, I can create something to re group hem once in excel.

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