Code Red > AutoLISP (Vanilla / Visual)

Another race!! (How fast can you change an entity/object)

(1/5) > >>

Mark:
According to the Developer Documentation

--- Quote ---ActiveX Automation is a new way to work programmatically with the contents of an AutoCADŽ drawing. In many instances, ActiveX works faster than traditional AutoLISP functions in manipulating AutoCAD drawing objects.
--- End quote ---
.

After getting smoked by Stig in the last race I'm in doubt. I say we put them to a test. What about changing the radius on 10,000 circles?

SMadsen:
You're on!  Not sure if ENTMOD can outperform ActiveX but let's try.

Edited: Timer will be started when it's time to modify radius', right? Not when creating the circles.

rugaroo:
Not to be rude, but doesn't anyone in here actually work???... :D

daron:
SSSShhh!

Mark:
Were are working........... :D

Here's what I put together Stig. Using your timer function of course.



--- Code: ---
(defun startTimer () (setq time (getvar "DATE")))
 
(defun endTimer (func)
  (setq time (- (getvar "DATE") time)
seconds (* 86400.0 (- time (fix time)))
)
  (gc)
  (outPut seconds func)
  )
(defun outPut (secs def)
  ;(princ "\nPurging...")
  ;(command "PURGE" "Layers" "*" "N")
  (gc)
  (princ (strcat "\nTimed " def ": " (rtos secs 2 6)))
  (princ)
  )

(defun chgCir (/ *mspace*)
  (startTimer)
  (setq *mspace* (vla-get-ModelSpace
  (vla-get-ActiveDocument (vlax-get-acad-object))
  )
)
  (vlax-for x *mspace*
    (if (= (vlax-get-property x 'ObjectName) "AcDbCircle")
      (vlax-put-property x 'Radius 0.15)
      )
   (vlax-release-object x); edited here forgot to release the obj's
    )
  (endTimer (vl-symbol-name 'chgCir))
  ); defun

--- End code ---
edited by MST

Navigation

[0] Message Index

[#] Next page

Go to full version