Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ACAD dynamic block: understanding parameters and expressions

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
Wojty1
2548 Views, 9 Replies

ACAD dynamic block: understanding parameters and expressions

Hello!

 

I am currently working on a dynamic 2D block (a tree) and having some trouble with the parameters.

After spending hours on YouTube and Google I still haven't figured out how the parameters (and expressions) work.

Below is a screenshot of my block showing the properties pane and the parameter manager.

 

2021-09-29 01_48_52-Greenshot.png

 

 

 

 

 

 

 

 

 

I tried changing the expressions, but AutoCAD throws an error, no matter how and where I change the expression.

2021-09-29 01_56_49-Parameter Error.png

 

 

 

 

 

 

 

I'm totally upset and really need some help.

 

The final block should look somewhat like on the screenshot below.

 

2021-09-29 02_04_27-Greenshot.png

 

 

 

 

 

 

 

 

 

Unfortunately this setup doesn't work properly. The outer ring of the tree moves out of the center point, etc.

 

This are two requirements of the final block and I would highly appreciate it if someone could help with the creation.

 

  1. The user can drag a grip (within a range of allowed values at defined increments) to set the diameter of the crown
    OR
    The user can enter a value to set the diameter of the crown in the properties window
  2.  The user can drag a grip (within a range of allowed values at defined increments) to set the diameter of the trunk
    OR
    The user can enter a value to set the diameter of the trunk in the properties window

 

 

Now something on the topic:

How do the parameter expressions work? Where can I enter a formula?

No matter what I do, AutoCAD tells me that the expression is wrong (see screenshot above).

 

If you need any more information or screenshots, please let me know.


Windows 10 Pro 64-bit / Windows 7 Pro 64-bit SP1
AutoCAD 2023 64-bit EN, Civil 3D 2022 / 2023 64-bit DE / EN
ASUS Maximus Hero VIII / Intel QuadCore Core i7-7700K @ 4.20GHz / EIZO FlexScan EV2411W 24" + EIZO FlexScan EV2416W 24" / 64 GB Corsair Vengeance LPX (4x 16 GB) Dual-Channel DDR4 @ 3200 MHz / 12 GB ASUS GeForce RTX 3060 OC V2
9 REPLIES 9
Message 2 of 10
Libbya
in reply to: Wojty1

Expressions/formulas do not work with action parameters.  They will work with constraints, but for such a simple block I would not recommend using constraints.  

 

Can you post the block?  Is there a relationship between the size of the trunk and the size of the crown that needs to be maintained by a formula?  If so, what is that relationship?  

Message 3 of 10
Libbya
in reply to: Libbya

Is this what you are trying to do?

 

 

Message 4 of 10
Wojty1
in reply to: Libbya

Hello @Libbya !

 

Yes, that is exactly what I am trying to do.

 

I created a new tree block from scratch, but it still doesn't work.

The problem is that the crown (Polyline) and the trunk (Circle) don't stay centered when I resize them (see ScreenCast).

Do you have an idea why that happens?

 

ScreenCast: https://knowledge.autodesk.com/community/screencast/82c9ca3c-c617-4e86-9d2d-70531ba96794 

 

 


Windows 10 Pro 64-bit / Windows 7 Pro 64-bit SP1
AutoCAD 2023 64-bit EN, Civil 3D 2022 / 2023 64-bit DE / EN
ASUS Maximus Hero VIII / Intel QuadCore Core i7-7700K @ 4.20GHz / EIZO FlexScan EV2411W 24" + EIZO FlexScan EV2416W 24" / 64 GB Corsair Vengeance LPX (4x 16 GB) Dual-Channel DDR4 @ 3200 MHz / 12 GB ASUS GeForce RTX 3060 OC V2
Message 5 of 10
Libbya
in reply to: Wojty1

It is best to post your block with your inquiry.  Probably you either didn't switch the parameter base points to midpoint or you didn't set the scale actions property base to independent and set the grip at the center of the circle.  If you need further assistance post your block.  

Message 6 of 10
Wojty1
in reply to: Libbya

Okay, thanks @Libbya 

 

Still having problems so I attached the drawing file.

Would be so glad if you could take a look at it.


Windows 10 Pro 64-bit / Windows 7 Pro 64-bit SP1
AutoCAD 2023 64-bit EN, Civil 3D 2022 / 2023 64-bit DE / EN
ASUS Maximus Hero VIII / Intel QuadCore Core i7-7700K @ 4.20GHz / EIZO FlexScan EV2411W 24" + EIZO FlexScan EV2416W 24" / 64 GB Corsair Vengeance LPX (4x 16 GB) Dual-Channel DDR4 @ 3200 MHz / 12 GB ASUS GeForce RTX 3060 OC V2
Message 7 of 10
Libbya
in reply to: Wojty1

Even though the parameter base is set to midpoint, you still need to set the scale action base property to independent and move the new base grip to that same midpoint location.  See screencast.

 

 

Message 8 of 10
Wojty1
in reply to: Wojty1

@Libbya Many thanks for your time and solution. I finally made it work.


Windows 10 Pro 64-bit / Windows 7 Pro 64-bit SP1
AutoCAD 2023 64-bit EN, Civil 3D 2022 / 2023 64-bit DE / EN
ASUS Maximus Hero VIII / Intel QuadCore Core i7-7700K @ 4.20GHz / EIZO FlexScan EV2411W 24" + EIZO FlexScan EV2416W 24" / 64 GB Corsair Vengeance LPX (4x 16 GB) Dual-Channel DDR4 @ 3200 MHz / 12 GB ASUS GeForce RTX 3060 OC V2
Message 9 of 10
Wojty1
in reply to: Wojty1

I've got one more question:

Is it possible to control the parameters with a command or script?

 

Let's say I've got a nice little forest over here with about 500 trees where each one is different in size.

I think you see where this is going: I would have to adjust 500 blocks manually (crown and trunk size) and that is really nasty.

Let's assume I have an ASCII coordinate file that looks like this:

 

Point_Number X-Coordinate Y-Coordinate Z-Coordinate Trunk_Diameter Crown_Diameter

 

Is there any way to automate the process? Maybe with block attributes?

 

Although I have read in the forums that it is currently not possible to adjust a parameter from an attribute value.

 

Anyway, any help appreciated.

 


Windows 10 Pro 64-bit / Windows 7 Pro 64-bit SP1
AutoCAD 2023 64-bit EN, Civil 3D 2022 / 2023 64-bit DE / EN
ASUS Maximus Hero VIII / Intel QuadCore Core i7-7700K @ 4.20GHz / EIZO FlexScan EV2411W 24" + EIZO FlexScan EV2416W 24" / 64 GB Corsair Vengeance LPX (4x 16 GB) Dual-Channel DDR4 @ 3200 MHz / 12 GB ASUS GeForce RTX 3060 OC V2
Message 10 of 10
mbickelVMG55
in reply to: Wojty1

It does seem that we can reference attribute fields in an instance of a block, but not in the the block definition. So you would need to define the block, then set up formulae, then copy the block 500 times (instead of inserting new block instances). I'm not saying this is a solution, just possibly something to help understand the blocks. 

Maybe... if a block w/ attributes was nested in another block, a formula referencing an attribute (in the inside block instance) could be built into the definition of the block containing it? I don't know what happens to attributes in nested blocks; maybe someone here can tell us or figure it out.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


”Boost