Parametric Blocks - is it possible to pass a parameter value in to a block attribute?

aridzv
edited February 2021 in 2D Drafting

Hi.
I have a set of parametric blocks representing pipes.
each one have a parameter for the length.
is it possible to pass the block parameter (representing the pipe length) value to a block attribute?
I've attached an example block:
and in that block, I want the value of parameter d1 to automatically assigned to the value field of the QUANTITY attribute
thanks,
Ari.

Comments

  • I did something that was update a attribute in a block based on another blocks attribute, you have to set the field to the attribute ID textvalue.

    Trying with simpler text from limited testing . %<\AcObjProp Object(%<_ObjId 103460128>%).TextString \f "%lu2%pr3">% can not put a field as value but I am happy to be shown if possible.

  • @ALANH
    thanks for the reply.
    I know how to get a value in to one attribute from another - this is not the case here.
    the problem is how to get a value from a parameter to an attribute.
    Ari.

  • ALANH
    edited February 2021

    Read the question backwards you want d1 value for dynamic block is easy. An alternative may be use a field that is length of line so avoid parametric, that worked for mtext will make something for block att if can find time.

  • The answer is now in the lisp section don't double post its confusing.

  • @ALANH
    thanks for the reply!
    1. the issue is parametric block. bricscad don't have dynamic blocks, this is part of the problem.
    2. I accept your comment about the double post. lets continue in the lisp section of the forum.

  • aridzv
    edited February 2021

    Bricscad support team sent me a short video that show's how to use formula field to assign parameter value to an attribute.
    I believe it can be helpful to others so I uploaded it over here.
    Many Thanks to Bricscad Team!
    Ari.

  • Hallo

    I am am trying to build something similar for an electrical block and I have experienced a very strange behavior:

    • I have created a block with a single move parameter between 2 entities (a box and a surface)
    • I have added an Associative dimension to express the distance dynamically
    • I have added an attribute with a field as indicated in the short video above.

    See the image below - while parameter works as expected:

    • sometime the associative dimension is updated and sometimes is not
    • sometimes the attribute updated (after running ATTSYNC) sometimes not.

     Can you help me understand this behavior ? is there a way we can correctly automate this ?

    I would believe being able to express a parameter graphically in some way (text or dimension) is critical, but I may be missing something or doing something wrong.

    Thanks in advance

    Luca

  • Really need a dwg to look at it properly.

    With fields you can not copy say the 3 objects as a new ID is required in the field value dimension length in the attribute.

    Not sure why your associative dimension is not working.

  • Regarding the issue with the associative dimension sometimes updating and sometimes not… there is a serious flaw with associative dimension somewhere.

    Even updating an object's custom property without any dimensional change can cause the associativity of a dimensions to break. There is very little you can do about that other than hope it doesn't happen too often and reassociate the dimension and hope it will stick.

  • See CALScript, freely available from www.calscript.com. CALScript enables you to parametrically define drawing parts from simple scripts. Simply add an ATTDEF entity to your script, and the CALScript objects will always show the correct attribute value. CALScript is easier and yet more powerful than dynamic blocks.

    CALScript objects can even communicate to each other, and this enables you to simulate complex systems.