Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Dynamic Block Array count Field

noe_pardoen
Participant

Dynamic Block Array count Field

noe_pardoen
Participant
Participant

Hello,

I’ve run into an issue while working on a Dynamic Block, and I hope someone can help me with this. The goal is to create a ruler line that I can stretch using an array, so multiple rulers are created. The distances between the rulers can vary (e.g., 500, 600, 700, 750, or 1000 mm). The stretching works fine, but the numbering of the rulers isn't working as expected.

 

I created two arrays starting from the zero point, so for example, you can display only the range from 120 to 140. This way, you can easily adjust which part is visible, without using an Xclip. If you were to fully draw the ruler and use an Xclip, the base point and block table would be at the same location, which makes it less flexible to adjust.

 

Here’s what I’ve done to start the numbering:

  • In the block, I went to Field.
  • I selected an object in the Object tab and linked the parameter Distance3.
  • I then clicked OK, reopened the text, and entered the following formula:
    (floor(@Length / 500)) + 1.

 

Additionally, I want the text coming from the Field to have no text background, so only the numbers are visible without any background or frame.

 

Does anyone know what I might be doing wrong or how to solve this? Thanks in advance!

2024-12-11_11h14_49.png

0 Likes
Reply
Accepted solutions (1)
340 Views
6 Replies
Replies (6)

j.palmeL29YX
Mentor
Mentor
Accepted solution

>>Here<< I have shown how you can number an array of "markers" (here the vertical lines).
Regarding to your current issue you have the problem, that it works only for one given distance between the markers (here 500). This value is a constant part of the formula

 

2024-12-11 16 12 11.png

 

and can not be substituted by a variable.
If you need different distances between the markers (e.g., 500, 600, 700, 750, or 1000 mm) mabe you can do it with some visibility states? 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes

noe_pardoen
Participant
Participant

Thanks for your suggestion!

I’ve successfully implemented the attribute with the field, and the formula is working just as I want. However, I’m encountering an issue with the field marker (the gray background). Even though I set FIELDDISPLAY to 0 and save the drawing, other users still see the marker when they open the drawing on their computers.

My question now is whether it's possible to make the field background permanently transparent, so others don’t see the marker when they open the drawing. It’s fine if the marker remains visible within the block, as long as it is hidden outside the block.

Additionally, I want to adjust the horizontal lines, which are currently 50 mm long by default. I want them to have different lengths based on an associated number:

  • 100 mm long for numbers like 0, 10, 20, etc.
  • 75 mm long for numbers like 5, 15, 25, etc.
  • 50 mm long for other numbers (such as 1, 2, 3, 4, etc.).

All lines should be drawn from the center, so they should not shift left or right.

Now, I have an additional question: I don’t want the length to start from 0. For example, if I only want to show a specific part of the line, such as between 120 and 140, the line should stretch from 0 to 140, which takes up too much space. This is not ideal as it makes the display too large. How can I adjust this so that the line does not stretch to the full length, but only shows the specific range?

Thanks again for your help! If you have any tips regarding the field marker or how I can adjust the lines, I’d appreciate it!

2024-12-13_15h56_51.png

0 Likes

j.palmeL29YX
Mentor
Mentor

Crossposting, 

continued >>here<<.  

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes

dylanclark3FGGS
Community Visitor
Community Visitor

The only problem i am having with this, is that the block has to align with 0,0 axis in order to count 0,1,2 etc. Otherwise the number does not start at 0, rather some arbitrary value such as 0.5 or 1.6 if not aligning with 0,0. Is there some way of fixing this so the grid can be copied or moved?

 

I did try setting the block within a block but as figured it was not counting at all..

 

Also, I am setting the decimal accuracy to 0, but it is still giving me the value at 0.00000.

0 Likes

j.palmeL29YX
Mentor
Mentor

Post your block please. 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes

noe_pardoen
Participant
Participant

Hi!

It seems like you are having a problem with the numbering not being aligned to the 0,0 point. This can cause the numbering to start not at 0, but at something like 0.5 or 1.6. Luckily, this can be fixed! Here is a detailed explanation to help you get started.

Step-by-step guide for correct numbering

1. Make sure the starting point is at 0,0
To begin with, the center or starting point of your numbering must be aligned to the coordinate 0,0.

If you have already created a block, you can adjust this in the Block Editor.
Go to the Base Point tab and move it to the place where the numbering should begin (for example, 0,0).
For extra precision, you can draw a small circle in the Block Editor at the point where the numbering should start.

2. Create an attribute for numbering
To link the numbering, create an attribute and follow these steps:

  • Open the tab for Default.

  • In the attribute, to the right of Default, click on the Insert Field icon.

  • Use the formula function:

  • Right-click on Insert Field in the formulas section.

3. Select the circle
In the opened window, choose Objects from the left column and then click on Object again.
Then click on Select Object and select the circle you previously added as a reference point.

4. Set the coordinates

  • Set the center of the circle as the reference.
  • Choose the axis you need (X, Y, or Z).
  • Make sure to set the value to 0 for each coordinate (X, Y, and/or Z). This must be repeated for each tab or window you have open.

5. Use the Dynamic Block within another block
If you want to use this block within another block, make sure the other block is also correctly aligned to the 0,0 point. This is essential; otherwise, the numbering will still not work properly.

Extra tip
This process may seem a bit complicated, so I recommend checking out the Dynamic Block Array Numbering post, where someone else showed me a video explaining how to set this up. A good visual explanation can sometimes provide that extra clarity.

I hope this helps you move forward! Good luck, and if you have any further questions, please ask them in the Dynamic Block Array Numbering post. 



0 Likes