Jump to content

An attribute that is a multiplication of two other Attributes within the same block?


DB007

Recommended Posts

Hi Everyone,

 

Can this be done? I have a block with several attributes. One of the attributes is the result of mulitplying two or more of the other attributes together. I want this to be calculated automatically everytime one of the attribute values changes.

 

They need to stay within the same block (I think) for when i extract the data to a text file.

 

If its not possible with attributes, will fields be any better? (I know even less about those than I do attributes!)

 

Also would need to work on LT and full AutoCAD?

 

Thanks in advance.

Link to comment
Share on other sites

  • Replies 35
  • Created
  • Last Reply

Top Posters In This Topic

  • JPlanera

    14

  • DB007

    9

  • KnoJa31

    7

  • steven-g

    2

Top Posters In This Topic

Posted Images

The way to accomplish this is through the "Formula" option within a field. But the mathmaticas are taken from cell data. If you can incorporate table info within your block, then this is the way you should do it

Link to comment
Share on other sites

Interesting...I was expecting a response on the lines of "No Chance!"

 

I never considered a table within a block. So would I need to change all my attributes to fields, or can I mix the two and still extract the data successfully?

Link to comment
Share on other sites

In a nut shell... A field "IS" extracted data, so your blocks should consist of a table(s) of info, and a field(the result of you multiplication).

 

The thing with fields, is you can extract pretty much any data from autocad. This may or may not be the best way to accomplish what you want. On the other hand, tables can also do calculations. If you can configure your blocks in a way where the table holds ALL the info, then you can create a seperate field with the "result" and extract that. I would play around with the different options given within each solution and figure out which one is best for you. As for attributes, you might want to stay away from them and stick to tables and fields. Attributes are locked values that cant be manipulated like that, unless you can write a LISP routine to do all the work, and im not capable of that... yet:lol:

 

Upon poking around... An Attribute CAN be a field... ATTEDIT and right-click on an attribute space, an option to insert field is there!! more fun for you to play with!

Edited by JPlanera
found new info
Link to comment
Share on other sites

No problem. Also, post your dwg here (if you can) with a description of what you are trying to do for myself and others to learn/help with similar issues! :)

Link to comment
Share on other sites

Its mostly in my head at the moment but when I've created a file that makes any kind of sense I will post it up.

 

Is it possible to data extract field information in the same way you can attributes? Attributes work perfectly for me, creating a text file that I can use in any other program but I cant seem to do the same with fields?

 

I can insert a field into an attribute but I cant then put that attribute into a table cell which i need to be able to use cell forumlas to add the values of my attributes together?

 

Hope that makes sense!:?

Link to comment
Share on other sites

You can definately use a program to calculate the 3rd attribute from 2 others and update its pretty easy, when inserting the block a lisp etc would provide the default answer for the 3rd attribute based on the two prior answers.

 

The fields would be a better way though as it would be automatic.

Link to comment
Share on other sites

You can definately use a program to calculate the 3rd attribute from 2 others and update its pretty easy, when inserting the block a lisp etc would provide the default answer for the 3rd attribute based on the two prior answers.

 

The fields would be a better way though as it would be automatic.

 

Yeah I thought this would be the case but unfortunately it needs to be used on LT stations too so the Lisp is out.

 

Thanks anyway.

Link to comment
Share on other sites

This is a very crude demonstration, but it should get you going...

 

http://screencast.com/t/Tox3cgmC

 

Use DATAEXTRACTION to output the data...

 

 

Wow that was great! Thanks for going to so much effort. I Particularly found useful the fact you copied the field expression straight into the field formula.

 

Presumably you could embed the result field into the original block. I will experiment with this.

 

Thanks very much

Link to comment
Share on other sites

You watched my screencast? Is that the general idea of what you want??

 

JPlanera,

 

This is exactly what I needed. I also managed to embed the field within the block. So I can now copy the block as many times as i want and the field is only relative to the attributes within its own block.

 

Ive attached a file showing my result. The text doesn't really make sense at the moment but basically if I change any of the 1st 3 attributes and regen/plot/save etc my weight attribute/field (a simple multiplication of the 3 and then a division to change to the units) automatically updates. Perfect! :D

 

Thanks for all your help. Im starting to understand why fields are so useful!

FIELDS.dwg

Link to comment
Share on other sites

  • 1 month later...

WOW!

So i have a similar situation.

I want to be able to insert a block and edit one attribute but it's value needs to shown in two other locations. I looked at the block DB007 attached and could not figure out how you got that to work. I'M DYIN' OVER HERE!!!! :|

 

I know i have to be missing something. I watched the screencast.

 

What im trying to have happen is two fields return the value of an attribute. I am using id's such as D9000P.

I was able to reproduce the steps that was created in the screencast. However, when looking at the block DB007 attached i was not able to put two and two together.

Would a diesel formula work best in this instance?

Link to comment
Share on other sites

I'm sure you can just repeat the process of referencing the field to the attribute...l do it twice. If you still have problems, attach the file you are working on and i will take a look at it

Link to comment
Share on other sites

  • 2 weeks later...

Jplanera

So i followed your screencast. i must be missing something.

I have attached the block that im working on. It is a simple wiring diagram relay. I have an attribute and a field embedded in the block.

 

I have attached the block. [ATTACH]25105[/ATTACH]

Link to comment
Share on other sites

When you insert this block, are the "two other locations" also in a block? Or are the just lables in the drawing? Does this block normally contain two attributes? seems redundant...

Link to comment
Share on other sites

Currently we dont have a block for the relay. There are too many variables to contend with. However, after some consideration, i could create the out line of the relay (the center box for the content and the two connectors on either side).

 

We have to have the id on both sides to indicate that it is the same connector. Normally we would use mtext to show the connector ids. it would be nice to have it where we enter in the value on one attribute and have it populate the field.

 

To make it even worse, there is actually text below the relay with the same connector number but it would be labeled Rxxxx.

 

So for instance: the connectors would be labeled D1234P and the text below the relay would be R1234.

 

My thinking was that i could take the 1234 out of the relay description and apply it to the connector ids. I guess for now i need to know how to connect the field to an attribute!! :lol:

 

I have played around with mimicking the screencast and have been able to do that. I just need the field in the block so that users can't mess it up. Which they will!

Link to comment
Share on other sites

At first glance, I dont get the reasoning for having the field and the attribute located in the same block.... So Ive attached a screencast showing how this can be done with an infinite amount of fields... You can place these anywhere in the drawing and the attribute will update the fields. Let me know what you think.

 

http://screencast.com/t/jKEKvgHf

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