Author Topic: ActiveX Speed  (Read 2637 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7529
ActiveX Speed
« on: April 20, 2006, 12:19:20 PM »
I just did a test:

Code: [Select]
      (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. >

That's quite the improvement in speed :).

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ActiveX Speed
« Reply #1 on: April 20, 2006, 12:36:51 PM »
How about this?
Code: [Select]
(entmake (list (cons 0 "CIRCLE")
               (cons 10 (list 0.0 0.0 0.0))
               (cons 40 20.0)))
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: ActiveX Speed
« Reply #2 on: April 20, 2006, 01:39:24 PM »
Code: [Select]
(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. >

Can you feed entmake variables?


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ActiveX Speed
« Reply #3 on: April 20, 2006, 01:47:15 PM »
Can you feed entmake variables?
Yup.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ActiveX Speed
« Reply #4 on: April 20, 2006, 01:53:06 PM »
Sure
Code: [Select]
(entmake (list (cons 0 "CIRCLE")
               (cons 10 (trans pt 1 0)))
               (cons 40 (/ cir_diam 2))))
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: ActiveX Speed
« Reply #5 on: April 20, 2006, 01:53:48 PM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC