Jump to content

ARRAY & ARRAYPATH in macro or script not the same as in command line


Recommended Posts

Posted

I'm trying to write either a script or a macro to make it easier to do an array that we will need to replicate on a regular basis. Basically, I want a path array to offset mtext every 20m along a centreline.

 

 

If I do this in the command line, it's fine:

ARRAY

select object

PA [path]

select path curve

M [method]

M [measure]

I [item]

20 [distance apart]

F [fill length of path]

A [align to path]

Y [confirm]

X [exit]

 

 

If I do this in a script or macro, I encounter a difficulty in that the type of array is limited to polar or rectangular. It doesn't even register that path is an option.

If I try a similar thing using ARRAYPATH, the options that come up from the macro/script are totally different to the command line options.

 

 

Am I missing something, or is CAD just unhelpful on this? Running LT, so can't do LISPs

  • 8 years later...
Posted

LOL, here's me googling the same thing 8 years later and coming up empty....

Posted (edited)

This is a lisp that will do something copying an object along a path. The issue here is that there is not much to go on with regards to what is the object so it uses pick point, there is so many options like rotate as object is placed along path. How is pick point selected.

 

(defun c:wow ( / oldsnap ent ins obj dist ch howmany len)
(setq oldsnap (getvar 'osmode))
(setq ent (entsel "\nPick object "))
(setq inspt (cadr ent))
(setq obj (vlax-ename->vla-object (car (entsel "\nPick path object "))))
(setq dist (getreal "\nEnter increment "))
(setq ch dist)
(setq len (vlax-get obj 'length))
(setq howmany (fix (/ len dist)))
(setvar 'osmode 0)
(repeat howmany
(setq pt (vlax-curve-getpointatdist obj ch))
(command "copy" ent "" inspt (list (car pt)(cadr pt)))
(setq ch (+ ch dist))
)
(setvar 'osmode oldsnap)
(princ)
)
(c:wow)

So provide a sample dwg.

 

Edited by BIGAL

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...