Jump to content

Block Attribute Calculation


churchill

Recommended Posts

Hi guys,

 

I have a requirement to create a block with a few attributes, but the attributes require a bit of composition behind the scenes. Here's an abstract example.

 

I need a block that represents a computer's identity. Each computer has 2 references that need to result in attributes that I can extract. One attribute is a unique reference across the project, and the other attribute is a room reference, and many computers can be in the same room.

 

Here are some example references.

 

Computer A

Unique Reference: DF.SALES.01

Room Reference: DG.SALES.07

 

Computer B

Unique Reference: DF.SALES.02

Room Reference: DG.SALES.07

 

Computer C

Unique Reference: DF.SALES.03

Room Reference: DG.SALES.07

 

Computer D

Unique Reference: DF.ADMINISTRATION.01

Room Reference: DG.ADMINISTRATION.02

 

Computer E

Unique Reference: DF.ADMINISTRATION.02

Room Reference: DG.ADMINISTRATION.02

 

As you can see from the above, the 'common' part for a computer is the middle 'SALES' or 'ADMINISTRATION' part, which 'technically' only needs to be put in/typed in by the user once for each computer. I need to automate this process to reduce user input error, such that they only enter 'SALES' or 'ADMINISTRATION' once and don't end up creating the below, which would be invalid.

 

Computer F

Unique Reference: DF.RECEPTION.09

Room Reference: DG.SALES.07

 

Thus I imagine I need a third property/field/attribute to specify 'room', and then formulate the Unique Reference and Room References, using this 'room' part in the middle.

 

The end goal here is that I need to be able to extract the above two references for each 'computer/block' and get them into Excel, and I need to be able to modify the 3 properties (room, unique reference and room reference) quickly, ideally using something like EATTEDIT, which is how we have edited attributes in the past.

 

Apologies that this may seem like an odd request! The use case above is abstracted, it's actually not for computers at all but I figured it would make more sense than complicating it with the actual application!

 

Many thanks in advance for any thoughts.

Link to comment
Share on other sites

Thoughts.... try the attached block, when you insert the block it prompts for the room, room number, and computer. When done you need to swith the visibility state to ON (thats just a name) and do a regen, the problem with this method is that it needs this visibility state for an attribute to read another attribute in the same block?

The top block in the drawing is the block as inserted, and the bottom one is with the vis state changed. The layout can be changed to suit. To edit the details you need to turn the vis state back to OFF.

 

Question.... your example isn't based on real world data - how many different combinations of data do you actually need, it could be possible to create a block with just a sort of multiple choice entry method.

Comp.dwg

Link to comment
Share on other sites

If you use a lisp you can insert a new block and it will ask the relevant questions

 

New PC y/n if yes than add 1 it searches at start for last pc number this is easy to do

Current room y/n if no pop up a list or pick room name from somewhere in dwg

Current unique y/n the users occupation else like current add 1 note if not exists then it will add 0+1

 

note pc using a-z means only 26 or 52 is limits

 

You need a work flow chart with y/n etc then a lisp could be put together

Link to comment
Share on other sites

Thoughts.... try the attached block, when you insert the block it prompts for the room, room number, and computer. When done you need to swith the visibility state to ON (thats just a name) and do a regen, the problem with this method is that it needs this visibility state for an attribute to read another attribute in the same block?

The top block in the drawing is the block as inserted, and the bottom one is with the vis state changed. The layout can be changed to suit. To edit the details you need to turn the vis state back to OFF.

 

Question.... your example isn't based on real world data - how many different combinations of data do you actually need, it could be possible to create a block with just a sort of multiple choice entry method.

 

Hi steven-g, this is very much starting to look like the stuff! Is there a way to do it at all without the whole visibility states bit? Just thinking in terms of minimising mouse click (although I think I see why you've had to do it, see end of post).

 

I'll expand on my scenario slightly to provide some context. In the above I was using computers as an example, essentially that's still the case. These blocks are to represent microcontrollers in a building. There can be thousands of them in a building. Each microcontroller has four properties, that combine to create the two references (Unique and Group) that I mentioned in my original post.

 

Essentially it would be awesome if we could end up with one block that just appears with the following six attributes when you double click on it in MSPACE:

 

The Four Microcontroller Properties

  • Parent Controller (Editable & Hidden)
  • Microcontroller Type (Editable & Hidden)
  • Microcontroller Individual Number on Parent Controller (Editable & Hidden)
  • Microcontroller Group Number on Parent Controller (Editable & Hidden)

The Two Resulting References

  • Microcontroller Unique Reference (Automatically Generated & Displayed on drawing)
  • Microcontroller Group Reference (Automatically Generated & Displayed on drawing)

The format for the Microcontroller Unique Reference is as follows:

<Microcontroller Type.value>.<Parent Controller.value>.Microcontroller Individual Number on Parent Controller.value>

The format for the Microcontroller Group Reference is as follows:

 DG.<Parent Controller.value>.Microcontroller Group Number on Parent Controller.value>

I'm just having some trouble putting them together myself, I can't get the automatically generated references to update on the fly when I combine it all into one block, I think this is why you used vis states in your example. I think I'm running into the issues reported in this thread here.

 

Your comment about multiple choice entry caught my attention, the property is indeed restricted to a number of values, namely either "DF", "DX", or "DE". I wasn't aware of a predefined 'drop down' functionality with attributes?

 

...note pc using a-z means only 26 or 52 is limits

Hi BIGAL, could you explain this limit that you mentioned?

Link to comment
Share on other sites

Yeah that post covers the reasons behind the vis state, there are apparently other methods of doing it but I like the vis state. Anyway here is another method which maybe suited but it depends on the range of your inputs, and if they can be preset into the block. You just insert the block and then make your choices from the cutom properties in the properties palette, I use this a lot for my door blocks I have lists set up for all different locks and finishes etc.

Comp2.dwg

Link to comment
Share on other sites

A-Z The alphabet has 26 characters A-Z but a computer recognises upper & lower case so there is actually 52 characters available.

 

My Work around 800 pc's

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