Message 1 of 4

Not applicable
07-01-2020
01:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to automate the ARRAYPATH command. I already have the object to array inserted at the start point of the polyline. I have the polyline I want to use as my path. My code has a prompt to ask the user how often to place the block (X feet). I want the object to be arrayed along the path every X feet. I also want the array to "fill" the polyline, so it's still close to X feet but not exactly.
Here is how I do this manually and it works fine:
Command: ARRAYPATH
Select objects: 1 found
Type = Path Associative = Yes
Select path curve:
Select grip to edit array or [ASsociative/Method/Base point/Tangent direction/Items/Rows/Levels/Align items/Z direction/eXit]<eXit>: i
Specify the distance between items along path or [Expression] <0.6342>: 8
Maximum items = 32
Specify number of items or [Fill entire path/Expression] <32>:
Select grip to edit array or [ASsociative/Method/Base point/Tangent direction/Items/Rows/Levels/Align items/Z direction/eXit]<eXit>: M
Enter path method [Divide/Measure] <Measure>: D
Select grip to edit array or [ASsociative/Method/Base point/Tangent direction/Items/Rows/Levels/Align items/Z direction/eXit]<eXit>: X
I'm trying to get the below code to work but it doesn't:
(defun c:arp (/ sel path dist1 pickpt) ;Arraypath for JFK barrier wall
(if (and (setq sel (entsel "\nSelect object to array:"))
(setq path (entsel "\nSelect path:"))
(setq dist1 (getdist "\nEnter the Distance Between Objects:")))
;then
(progn
;; sets the variable pickpt with the second list element from the entsel function
(setq pickpt (cadr path))
(command "._arraypath" sel "" (osnap pickpt "NEA") "I" dist1 "F" "M" "D" "X" );...
)
)
(princ))
Here is the output in CAD:
Command: ARP
Select object to array:
Select path:
Enter the Distance Between Objects:12
._arraypath
Select objects: 1 found
Select objects:
Type = Path Associative = Yes
Select path curve:
Enter number of items along path or [Orientation/Expression] <Orientation>: I Requires an integer between 1 an 32767, or option keyword.
Enter number of items along path or [Orientation/Expression] <Orientation>: 12
Specify the distance between items along path or [Divide/Total/Expression]: F The syntax is incorrect or a variable is not defined. Reenter the expression or value.
Specify the distance between items along path or [Divide/Total/Expression]: M The syntax is incorrect or a variable is not defined. Reenter the expression or value.
Specify the distance between items along path or [Divide/Total/Expression]: D
Select grip to edit array or [ASsociative/Method/Base point/Tangent direction/Items/Rows/Levels/Align items/Z direction/eXit]<eXit>: X
Solved! Go to Solution.