Author Topic: "Fit" array in dynamic block?  (Read 365 times)

0 Members and 1 Guest are viewing this topic.

MaDcAdDeR

  • Mosquito
  • Posts: 7
"Fit" array in dynamic block?
« on: July 14, 2016, 05:05:01 pm »
Hi,

I'm trying to figure out if there is any way that I could have the array in my dynamic block "fit" to any length as opposed to having it be incremental having the array spacing be at 20'.

Example: If the block is stretched to be 65'-0", I would like the dots to be evenly spaced to not exceeding 20'-0" but at the same time fit for the overall length.
Please see attached for an example.
Possibly there is a way to add a formula to the array parameters but, I haven't been able to find it yet.

Thanks!

Jeff H

  • Needs a day job
  • Posts: 5705
Re: "Fit" array in dynamic block?
« Reply #1 on: July 14, 2016, 08:03:58 pm »
You can use the array command to create a path array and achieve something similar.
Attached is same drawing with path arrays with the measure and divide option. You can use the grips of the polyline to edit it length and see the result.

Master_Shake

  • Swamp Rat
  • Posts: 1092
Re: "Fit" array in dynamic block?
« Reply #2 on: July 15, 2016, 08:13:57 am »
As a dynamic block? I don't think so, you are limited to traditional XY arrays. As Jeff mentioned the path array is a perfect function but that would occur outside of the dynamic block.

However I would take the lisp route.

Find the length
Code - Auto/Visual Lisp: [Select]
  1. (setq len (vla-get-length(vlax-ename->vla-object ent)))

Calculate quantity
Code - Auto/Visual Lisp: [Select]
  1. (setq num (1 + (fix (/ len spacing))))

Divide the line with blocks instead of point
Code - Auto/Visual Lisp: [Select]
  1. (vl-cmdf "._divide" ent "B" "AT" "N" num)