Results 1 to 7 of 7

Thread: Create LISP routine to perform calculations based on Dynamic Block properties

  1. #1
    Member
    Join Date
    2006-01
    Posts
    3

    Default Create LISP routine to perform calculations based on Dynamic Block properties

    Hi:

    I am new to dynamic blocks-here whar I got. I have created a dynamic block for an overhanging simply supported beam. This block I can stretch and do other things to get attribute data (via fields) to use in analyze the beam. Now since I can not do max or min or if statements in a field formula I want to run a lisp routine to do my struct. analysis. How do I incorporate that into my dynamic block? Please help!

    s.

    Jason

  2. #2
    AUGI Addict .chad's Avatar
    Join Date
    2006-04
    Location
    is it lunch time yet?
    Posts
    1,125

    Default Re: Create LISP routine to perform calculations based on Dynamic Block properties

    Quote Originally Posted by atwoodjason
    Hi:

    I am new to dynamic blocks-here whar I got. I have created a dynamic block for an overhanging simply supported beam. This block I can stretch and do other things to get attribute data (via fields) to use in analyze the beam. Now since I can not do max or min or if statements in a field formula I want to run a lisp routine to do my struct. analysis. How do I incorporate that into my dynamic block? Please help!

    s.

    Jason
    i know slim and none about lisp programing, but you should be able to extract the attributes in the block and calculate that way.

    you can use the EatText command, or with a little work can actually set up property sets and use ADT scheduling features to work with block references.

    there may very well be a cleaner way to do what you want, i just dont know it.

    ps - welcome to the forum
    This aggression will not stand. Man.

  3. #3
    Dynamic Blockhead Mod Chris.N's Avatar
    Join Date
    2001-12
    Location
    Rochester, MN
    Posts
    2,561

    Default Re: Create LISP routine to perform calculations based on Dynamic Block properties

    Quote Originally Posted by atwoodjason
    Hi:

    I am new to dynamic blocks-here whar I got. I have created a dynamic block for an overhanging simply supported beam. This block I can stretch and do other things to get attribute data (via fields) to use in analyze the beam. Now since I can not do max or min or if statements in a field formula I want to run a lisp routine to do my struct. analysis. How do I incorporate that into my dynamic block? Please help!

    s.

    Jason
    you can set minimum and maximum values to your parameters in the Block Editor.

    i'm not a programmer, so i'm not going to be much help with you there.

    would you like to learn more on creating DB's by signing up for a class? i got a link in my sig line below... (ATP170)

    and glad to see you here!
    Sometimes, i get lost in my own thoughts and need to ask directions to find my way back.
    S&D DB Sharing Forum

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,854

    Default Re: Create LISP routine to perform calculations based on Dynamic Block properties

    Quote Originally Posted by atwoodjason
    Hi:

    I am new to dynamic blocks-here whar I got. I have created a dynamic block for an overhanging simply supported beam. This block I can stretch and do other things to get attribute data (via fields) to use in analyze the beam. Now since I can not do max or min or if statements in a field formula I want to run a lisp routine to do my struct. analysis. How do I incorporate that into my dynamic block? Please help!

    s.

    Jason
    Hi Jason,

    Depending on your DB, you will probably want to check for the EffectiveName Property in your AutoLISP routine. You can also extract the information in your Attributes to do your calculations.

    If you would like, a Moderator can get this moved over to the AutoLISP forum. Just let us know in this thread. We can help you with your program there.
    Last edited by Opie; 2006-12-27 at 02:01 AM.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    Member
    Join Date
    2006-01
    Posts
    3

    Default Re: Create LISP routine to perform calculations based on Dynamic Block properties

    Hi:

    Yes please move it if it will help. Let me clarify something- would like this to work such that say I stretch my beam the calculations will update. I dont want extract the attribute info to an external file. Ultimately I could do what want using simple field calculation if only I had the options of if statements and/ or main/max. I guess that would be a wish for field calc.

    thanx

    Jason

  6. #6
    100 Club
    Join Date
    2005-10
    Posts
    113

    Default Re: Create LISP routine to perform calculations based on Dynamic Block properties

    hi,
    i've done something similar. to your block add an attribute and make the attribute a field with "distance" as the field. this will update when you stretch your dynamic block. minor warning, your must "regen" for the field to visibly update. i create this attribute as invisible so it's not in my (drafting) way but i can (attmode=2) to see it. i also warn that this can be edited by the user thru regular attribute editing and once done, the field is removed and regular text is in its place.

    to add this attribute to your dynblock, type "attdef" and in the dialog box there is a button (to the right of "value") to insert a field. select the category of "objects" and the reference property of "distance". you can also setup formatting such as feet & inches or whatever. close your block. when imported to your working drawing it will reflect the distance of the block. you can access this value thru programming. the link below is my earlier query (early dec 06), and a few people answered (thankfully).

    http://forums.augi.com/showthread.php?t=51593

    i also highly recommend a blog by mark douglas dated 25july05 at
    http://mdouglas.blogs.com/in_the_dyn...c_lisp_co.html

    hope my two cents doesn't deserve change,
    karl

  7. #7
    Administrator Mike.Perry's Avatar
    Join Date
    2001-03
    Posts
    13,499

    Default Re: Create LISP routine to perform calculations based on Dynamic Block properties

    Quote Originally Posted by atwoodjason
    Yes please move it if it will help.

    <SNIP>
    Hi Jason

    Done!

    Thread moved from the AutoCAD Dynamic Blocks forum to this one...

    Thanks, Mike

    Forum Manager

Similar Threads

  1. Is Lisp the right tool to create this routine?
    By Gary.182361 in forum AutoLISP
    Replies: 2
    Last Post: 2009-08-10, 07:03 AM
  2. Incorporating a dynamic block into a lisp routine
    By charlie.bauer341340 in forum AutoLISP
    Replies: 7
    Last Post: 2006-01-11, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •