HFBandit Posted December 20, 2016 Posted December 20, 2016 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 Quote
HFB Posted January 23 Posted January 23 LOL, here's me googling the same thing 8 years later and coming up empty.... Quote
BIGAL Posted January 25 Posted January 25 (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 January 25 by BIGAL Quote
Recommended Posts
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.