Author Topic: ( Challenge ) How fast can you convert these?  (Read 27110 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
( Challenge ) How fast can you convert these?
« on: December 05, 2008, 09:19:49 AM »
Using the attached .dwg, show us how fast you can convert the existing entities/objects into something else. i.e. from points to circles.

the .dwg contains about 10,000 ACAD points.
TheSwamp.org  (serving the CAD community since 2003)

Notsober

  • Guest
Re: ( Challenge ) How fast can you convert these?
« Reply #1 on: December 05, 2008, 09:24:31 AM »
i turned it into an empty drawing...

was that fast, or was that fast??

 :lol:

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ( Challenge ) How fast can you convert these?
« Reply #2 on: December 05, 2008, 09:26:56 AM »
:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ( Challenge ) How fast can you convert these?
« Reply #3 on: December 05, 2008, 09:28:24 AM »
PS: Isn't the count more like 11336?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: ( Challenge ) How fast can you convert these?
« Reply #4 on: December 05, 2008, 09:34:04 AM »
TheSwamp.org  (serving the CAD community since 2003)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ( Challenge ) How fast can you convert these?
« Reply #5 on: December 05, 2008, 09:38:30 AM »
My routine took about 12 seconds on my old machine. :oops:
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.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8690
  • AKA Daniel
Re: ( Challenge ) How fast can you convert these?
« Reply #6 on: December 05, 2008, 09:40:40 AM »
mine  :oops:

Code: [Select]
(defun c:doit ( / activedocument c e iacadapplication modelspace s)
  (vl-load-com)
  (setq IAcadApplication (vlax-get-acad-object)
ActiveDocument (vla-get-ActiveDocument IAcadApplication)
ModelSpace (vla-get-ModelSpace ActiveDocument)
  )
  (setq s (ssget "X" (list (cons 0 "POINT"))))
  (setq c 0)
  (if s
    (progn
      (While (< c (sslength s))
       (setq e (vlax-ename->vla-object (cdr (car (entget (ssname s c))))))
(vla-Addcircle ModelSpace (vlax-3d-point (vlax-get e 'Coordinates )) 15)
(vla-Erase e)
(setq c (1+ c))
      )
    )
    (alert (strcat "Could Not find any Points"))
  )
  (princ)
)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: ( Challenge ) How fast can you convert these?
« Reply #7 on: December 05, 2008, 09:40:45 AM »
about 8 second
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: ( Challenge ) How fast can you convert these?
« Reply #8 on: December 05, 2008, 09:43:49 AM »
About 2 seconds using VBA.

Code: [Select]
Public Sub ConverterPoints()
    Dim objPoint As AcadPoint
    Dim objCircle As AcadCircle
    Dim StartTime, EndTime As Date
   
    StartTime = Now
    For Each objPoint In ThisDrawing.ModelSpace
        Set objCircle = ThisDrawing.ModelSpace.AddCircle(objPoint.Coordinates, 30)
        objPoint.Delete
    Next objPoint
    EndTime = Now
    Debug.Print DateDiff("s", StartTime, EndTime)
End Sub
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Hedgehog

  • Guest
Re: ( Challenge ) How fast can you convert these?
« Reply #9 on: December 05, 2008, 09:47:11 AM »
I changed 'em all to crosses instantly... pdmode  :wink:

... just don't set it to 4... sends yer eyes wappy

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ( Challenge ) How fast can you convert these?
« Reply #10 on: December 05, 2008, 09:47:23 AM »
Hey Matt this is a LISP forum.
 :evil:
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: 7527
Re: ( Challenge ) How fast can you convert these?
« Reply #11 on: December 05, 2008, 10:12:12 AM »
< Elapsed time: 0.953000 seconds. >  :-)

Code: [Select]
(defun c:test (/ ss *time*)
  (setq *time* (getvar 'MILLISECS)
ss     (mapcar 'cadr (ssnamex (ssget "_x" '((0 . "POINT")))))
  )
  (while ss
    (entmakex (list '(0 . "CIRCLE")
    (assoc 10 (entget (car ss)))
    '(40 . 1.0)
      )
    )
    (entdel (car ss))
    (setq ss (cdr ss))
  )
  (princ
    (strcat "\n < Elapsed time: "
    (rtos (/ (- (getvar 'MILLISECS) *time*) 1000.0) 2 6)
    " seconds. > "
    )
  )
)
« Last Edit: December 05, 2008, 01:19:37 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8690
  • AKA Daniel
Re: ( Challenge ) How fast can you convert these?
« Reply #12 on: December 05, 2008, 10:48:16 AM »
nice  8-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ( Challenge ) How fast can you convert these?
« Reply #13 on: December 05, 2008, 10:53:26 AM »
Looks like the vla-add method is the fastest lisp. Twice as fast as my entmake. :x
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: 7527
Re: ( Challenge ) How fast can you convert these?
« Reply #14 on: December 05, 2008, 11:08:07 AM »
< Elapsed time: 0.687000 seconds. >  :-D

*updated per MP's comment

Code: [Select]
(defun c:test (/ *time* n e ss)
  (setq *time* (getvar 'millisecs)
ss     (ssget "_x" '((0 . "POINT")))
n      -1
  )
  (repeat (sslength ss)
    (entmakex
      (list '(0 . "CIRCLE")
    '(62 . 1)
    (assoc 10 (entget (setq e (ssname ss (setq n (1+ n))))))
    '(40 . 1.0)
      )
    )
    (entdel e)
  )
  (princ
    (strcat "\n < Elapsed time: "
    (rtos (/ (- (getvar 'millisecs) *time*) 1000.0) 2 6)
    " seconds. > "
    )
  )
)
« Last Edit: December 05, 2008, 01:18:12 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC