@Anonymous wrote:
Ok I decided to put the code in a text file so I can post it.
That's a lot to look through....
I'm not aware of their being any limit to the number of expressions you can have in a (repeat) function, so I imagine that it's some other function inside the (repeat) that's being fed too many arguments.
BUT if there is a limit in (repeat) itself, and it's purely in the number of AutoLISP functions you can have inside it, that code may well exceed it. One thing you can do to reduce the sheer quantity of function calls used is to set more than one variable within one (setq) function. You can replace these seven functions near the beginning:
(setq endang (- (nth rn RSPEORIENT) (nth rn RSPSORIENT)))
(setq endangp (* PI (/ (- 90.0 endang) 180.0)))
(setq lninpt2 (polar TANKCTR endangp pltinrad))
(setq lnoutpt2 (polar TANKCTR endangp pltoutrad))
(setq mirang (/ endang 2))
(setq mirangp (* PI (/ (- 90.0 mirang) 180.0)))
(setq mirlnpt (polar TANKCTR mirangp pltoutrad))
with this one function:
(setq
endang (- (nth rn RSPEORIENT) (nth rn RSPSORIENT))
endangp (* PI (/ (- 90.0 endang) 180.0))
lninpt2 (polar TANKCTR endangp pltinrad)
lnoutpt2 (polar TANKCTR endangp pltoutrad)
mirang (/ endang 2)
mirangp (* PI (/ (- 90.0 mirang) 180.0))
mirlnpt (polar TANKCTR mirangp pltoutrad)
)
Similarly, you can execute more than one consecutive command within one (command) function. You can replace these four functions:
(command "trim"
(nth 0 ssent1)
(nth 0 ssent2)
""
radtrimpt1
""
""
)
(command "trim"
(nth 0 ssent1)
(nth 0 ssent2)
""
radtrimpt2
""
""
)
(command
"_insert"
"C:/AutoCAD lsp Files/3D files/Platforms/Radial/Platform Inside Base.DWG"
lninpt1
""
""
""
)
(command "explode" "l" "")
with this one function:
(command
"trim" (nth 0 ssent1) (nth 0 ssent2) "" radtrimpt1 "" "" ;;;;; is there an extra Enter at the end?
"trim" (nth 0 ssent1) (nth 0 ssent2) "" radtrimpt2 "" "" ;;;;; is there an extra Enter at the end?
"_insert" "C:/AutoCAD lsp Files/3D files/Platforms/Radial/Platform Inside Base.DWG" lninpt1 "" "" ""
"explode" "l" ""
)
and I think you can conflate those two Trim commands into one, also, since they use the same Trimming edges.
[And by the way, you don't need the .DWG filetype ending on the drawing name -- it won't Insert any other kind of file.]
Kent Cooper, AIA