Jump to content

Calculating with attribute values


MarcoW

Recommended Posts

I was wondering, is it possible to collect a bunch of blocks / attributes and calculate with it?

 

For example if one block called "light" has an attribute with value "100" (meaning 100 Watts) and another block "light" with att.value "200", can we add em up together?

 

Don't need lisp but maybe some useful links so I can read more about it.

Link to comment
Share on other sites

If you wanted to use a LISP, the attribute values are STRings, so you would need to convert them into either INTegers or REALs, using such functions as: atoi or distof, before performing your calculations.

 

Lee

Link to comment
Share on other sites

I was wondering, is it possible to collect a bunch of blocks / attributes and calculate with it?

 

For example if one block called "light" has an attribute with value "100" (meaning 100 Watts) and another block "light" with att.value "200", can we add em up together?

 

Don't need lisp but maybe some useful links so I can read more about it.

 

Hey Marco,

 

Attached is a program and drawing for you to test the program. It totals a block name with its attribute value and places it in another block. You can modify the program easy by changing the block names and attribute tags in the program. Just review the drawing and program and you will see what needs to be done to make it suit your own needs. Any help needed feel free to ask.

 

Good Luck,

The Buzzard

BOM.dwg

BOM.lsp

BOM.jpg

Link to comment
Share on other sites

@ The Buzzard:

Thank you for sharing, it is exactly what I mean. I will read into the comments that are placed within the LISP. It looks as if it can be learned by me :). If I can I will try to modify it with a second attribute, like "only add up the values if the second attribute is v1".

So the result wil be a table like:

Version Total

V1 10

V2 12

V3 6

 

And not total = 28 / But thats for later, now I ll have to dig in my work.

 

@ Lee:

That it were string I knew, and that it should be converted somehow also. How, thats anonther thing. I see you had a hand in the Buzzards lisp, or at least he credits you for it. Nice work.

 

@ The Buzzard again:

Am I correct: you where on the forum at 5.42 am? May I ask where you live?

Link to comment
Share on other sites

@ The Buzzard:

Thank you for sharing, it is exactly what I mean. I will read into the comments that are placed within the LISP. It looks as if it can be learned by me :). If I can I will try to modify it with a second attribute, like "only add up the values if the second attribute is v1".

So the result wil be a table like:

Version Total

V1 10

V2 12

V3 6

 

And not total = 28 / But thats for later, now I ll have to dig in my work.

 

@ Lee:

That it were string I knew, and that it should be converted somehow also. How, thats anonther thing. I see you had a hand in the Buzzards lisp, or at least he credits you for it. Nice work.

 

@ The Buzzard again:

Am I correct: you where on the forum at 5.42 am? May I ask where you live?

 

 

Sorry I am late,

 

I forgot to log out. I was on the forum all crazy kind of hours, I guess I must be bored. My location is Manhattan, NY USA.

Anyway the program is annotated completely for your benefit. Please study the blocks as to the way they are named and their respected attribute tags. Compare this information to the program. You can makeup your own blocks the way you wish and just modify the block names and attribute tags in the program. There is nothing hard about it at all. If you get stuck please feel free to ask questions.

 

Just to mention, Lee gave me some great help last year for a program that was similar to this one. I had put some extra time on my own trying to get the program to work the way I wanted it to.

 

You have a good start now. If you decide to change this program on your own there are plenty of resources for you to choose from to help you learn lisp.

 

Good Luck,

The Buzzard

Link to comment
Share on other sites

Just to mention, Lee gave me some great help last year for a program that was similar to this one. I had put some extra time on my own trying to get the program to work the way I wanted it to.

 

Thanks for the mention mate :D

Link to comment
Share on other sites

Thanks for the mention mate :D

 

Thanks for the help mate

 

You are always a big influence on the programs I make. Sometimes I find things in the examples you provide that lead me to answers for other programs yet to be conceived.

Link to comment
Share on other sites

Thanks for the help mate

 

You are always a big influence on the programs I make. Sometimes I find things in the examples you provide that lead me to answers for other programs yet to be conceived.

 

Always good to hear I can be of some assistance :D

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