Not really a
challenge , but if you feel inclined ..
Anyone see a way to speed this routine up, based on the data provided ??
Essentially it's taking a point list and 'connecting the dots' with lines in the current UCS.
I tried an ActiveX solution but it's about 4.5 times slower.
Haven't looked at ARX or C# yet ....
DATA :
(setq vertexList1 (list (setq sp (list 0. 0. 0.))
(list 200. 0. 0.)
(list 200. 100. 0.)
(list 0. 100. 0.)
sp
)
layerName (getvar "CLAYER")
)
ROUTINE:
(defun test13 (vertexList layerName / TranslatedList DXF210)
;; Codehimbelonga kdub 2010.06.22
(setq TranslatedList (mapcar '(lambda (x) (trans x acucs acworld)) vertexList)
DXF210 (trans '(0 0 1) 1 0 T)
)
(foreach ptPair (mapcar (function (lambda (a b) (list a b)))
TranslatedList
(cdr TranslatedList)
)
(entmakex (list '(0 . "LINE")
'(100 . "AcDbLine")
(cons 8 layerName)
(cons 10 (car ptPair))
(cons 11 (cadr ptPair))
(cons 210 DXF210)
)
)
)
)
SOME OPTIONS :
(defun kdub:drawOneLineEn (sp ep la /)
;; Codehimbelonga kdub 2010.06.22
(entmakex (list '(0 . "LINE")
'(100 . "AcDbLine")
(cons 8 la)
(cons 10 (trans sp acucs acworld))
(cons 11 (trans ep acucs acworld))
(cons 210 (trans '(0 0 1) 1 0 T))
)
)
)
(defun test12 (vertexList layerName /)
;; Codehimbelonga kdub 2010.06.22
(foreach ptPair (mapcar (function (lambda (a b) (list a b)))
vertexList
(cdr vertexList)
)
(kdub:drawOneLineEn (car ptPair) (cadr ptPair) layerName)
)
)
Some TEST Results :Benchmarking [M.P. 2005 < revised kdub 2005>] ...............
Elapsed milliseconds for 4096 iteration(s)/ relative Timing :
(TEST12 VERTEXLIST1 LAYERNAME).....1015 / 1.0150 <slowest>
(TEST13 VERTEXLIST1 LAYERNAME).....1000 / 1.0000 <fastest>