Code Red > AutoLISP (Vanilla / Visual)
ActiveX Speed
ronjonp:
I just did a test:
--- Code: --- (vla-AddCircle
doc
(vlax-3d-point (trans pt 1 0))
(/ cir_diam 2)
)
2770 iterations
< Elapsed time: 4.812000 seconds. >
==============================
(command ".circle" pt "D" cir_diam)
2770 iterations
< Elapsed time: 70.281000 seconds. >
--- End code ---
That's quite the improvement in speed :).
CAB:
How about this?
--- Code: ---(entmake (list (cons 0 "CIRCLE")
(cons 10 (list 0.0 0.0 0.0))
(cons 40 20.0)))
--- End code ---
ronjonp:
--- Code: ---(defun ent(/)
(start-timer)
(repeat 2770
(entmake (list (cons 0 "CIRCLE")
(cons 10 (list 0.0 0.0 0.0))
(cons 40 20.0)
)
)
)
(end-timer)
)
;< Elapsed time: 1.032000 seconds. >
(defun ax(/)
(start-timer)
(repeat 2770
(vla-AddCircle
(vla-get-modelspace
(vla-get-activedocument (vlax-get-acad-object))
)
(vlax-3d-point (trans '(0 0 0) 1 0))
(/ 20 2)
)
)
(end-timer)
)
;< Elapsed time: 2.219000 seconds. >
(defun cmd(/)
(start-timer)
(repeat 2770
(command ".circle" "0,0,0" "D" "25")
)
(end-timer)
)
;< Elapsed time: 20.953000 seconds. >
--- End code ---
Can you feed entmake variables?
T.Willey:
--- Quote from: ronjonp on April 20, 2006, 01:39:24 PM ---Can you feed entmake variables?
--- End quote ---
Yup.
CAB:
Sure
--- Code: ---(entmake (list (cons 0 "CIRCLE")
(cons 10 (trans pt 1 0)))
(cons 40 (/ cir_diam 2))))
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version