+ Reply to Thread
Page 6 of 6 FirstFirst ... 4 5 6
Results 51 to 54 of 54
  1. #51
    Full Member Kerry Brown's Avatar
    Using
    not applicable
    Join Date
    Jan 2006
    Location
    Brisbane, Australia
    Posts
    98

    Default

    Registered forum members do not see this ad.

    Unless you are drawing thousands of entitys the difference between entmake and VL is not that much.

    just for info, the panacea link forgot about (vlax-invoke ... which does NOT require lists being converted to vlax-3D-Points (see Test14)

    For instance, try these

    Code:
    (defun date->sec (/ s)
      (setq s (getvar "DATE"))
      (* 86400.0 (- s (fix s)))
    )
     
     
    (defun c:test11 (/ i timer)
      (setvar "cmdecho" 0)
      (setvar "nomutt" 1)
      (setvar "OSMODE" 0)
      (setq i     1
            timer (date->sec)
      )
      (while (< i 1000)
        (command "._line" (list i i 0.0) (list (+ 2 i) (1+ i) 0.0) "")
        (setq i (1+ i))
      )
      (alert (rtos (- (date->sec) timer) 2 6))
      (setvar "cmdecho" 1)
      (setvar "nomutt" 0)
    )
     
     
    (defun c:test12 (/ i timer)
      (setq i     1
            timer (date->sec)
      )
      (while (< i 1000)
        (entmake (list (cons 0 "LINE")
                       (cons 10 (list i i 0.0))
                       (cons 11 (list (+ 2 i) (1+ i) 0.0))
                 )
        )
        (setq i (1+ i))
      )
      (alert (rtos (- (date->sec) timer) 2 6))
    )
     
     
    (defun c:test13 (/ ms i timer)
      (vl-load-com)
      (setq i     1
            timer (date->sec)
      )
      (setq ms (vla-get-modelspace
                 (vla-get-activedocument (vlax-get-acad-object))
               )
      )
      (while (< i 1000)
        (vla-addline ms
                     (vlax-3d-point (list i i 0.0))
                     (vlax-3d-point (list (+ 2 i) (1+ i) 0.0))
        )
        (setq i (1+ i))
      )
      (alert (rtos (- (date->sec) timer) 2 8))
    )
     
     
    (defun c:test14 (/ ms i timer)
      (vl-load-com)
      (setq i     1.0
            timer (date->sec)
      )
      (setq ms (vla-get-modelspace
                 (vla-get-activedocument (vlax-get-acad-object))
               )
      )
      (while (< i 1000)
        (vlax-invoke ms
                     'addline
                     (list i i 0.0)
                     (list (+ 2 i) (1+ i) 0.0)
        )
        (setq i (1+ i))
      )
      (alert (rtos (- (date->sec) timer) 2 8))
    )
    Regards Kerry
    Perfection is not optional.
    another Swamper

  2. #52
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Gigabyte GA-X58A-UD3R
    CPU:
    i7 930 @ 2.8gHz
    RAM:
    12GB
    Graphics:
    Quadro FX580
    Stotage:
    Western Digital 280GB
    Monitor:
    2-Dell 1905FP monitors
    Using
    Civil 3D 2011
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,128

    Default

    Quote Originally Posted by Kerry Brown View Post
    Unless you are drawing thousands of entitys the difference between entmake and VL is not that much.
    I agree.

    Quote Originally Posted by Kerry Brown
    just for info, the panacea link forgot about (vlax-invoke ... which does NOT require lists being converted to vlax-3D-Points (see Test14)
    Good point. Thanks for the reminder. I'll add a link to your post here.

    Quote Originally Posted by Kerry Brown
    For instance, try these....
    I changed the (alert) calls to (princ) and looped it a few times. Here are the results I got:

    PHP Code:
    Command: (repeat 5 (progn (c:test11)(c:test12)(c:test13)(c:test14)))


    Command0.797018
    Entmake
    0.046992
    VLA1
    0.18700361
    VLA2
    0.12500435

    Command
    0.687021
    Entmake
    0.063005
    VLA1
    0.17199665
    VLA2
    0.12500435

    Command
    0.703999
    Entmake
    0.045986
    VLA1
    0.18800944
    VLA2
    0.12500435

    Command
    0.687021
    Entmake
    0.078012
    VLA1
    0.15598387
    VLA2
    0.12500435

    Command
    0.703034
    Entmake
    0.063005
    VLA1
    0.15598387
    VLA2
    0.14097691 

  3. #53
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows Vista Home Premium (32-bit)
    Using
    AutoCAD 2010
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    10,248

    Default

    I never realised that vlax-invoke/get were quicker than the equivalent methods...

  4. #54
    Senior Member devitg's Avatar
    Computer Details
    devitg's Computer Details
    Operating System:
    XP
    Monitor:
    VG2021WM VIEW SONIC
    Using
    AutoCAD 2008
    Join Date
    Apr 2005
    Location
    CORDOBA ARGENTINA
    Posts
    101

    Default

    Quote Originally Posted by Lee Mac View Post
    IMO, some things are easier in Vanilla LISP, and some easier in Visual.
    Hi , I agree. I use both .

Similar Threads

  1. Fields and Entmake
    By lpseifert in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 11th Feb 2010, 03:17 pm
  2. Entmake (again)
    By flowerrobot in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 10th Jul 2009, 07:30 am
  3. Entmake Hatch
    By Lee Mac in forum AutoLISP, Visual LISP & DCL
    Replies: 38
    Last Post: 21st Apr 2009, 09:06 pm
  4. New ucs using entmake
    By Hmm.. in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 2nd Sep 2008, 03:16 pm
  5. entmake
    By kipp in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 24th May 2005, 09:56 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts