Author Topic: Block select Lisp needed...  (Read 17391 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Block select Lisp needed...
« Reply #30 on: August 27, 2004, 09:20:21 AM »
Code: [Select]

Details;
1 block (block1) 3 attributes
10,000 insertions of block1.
2,500 contain the string ("E") in one on the attributes we are looking for.

SMadsen (SUBST method)
Elapsed time: 3.2030 seconds

MThomas
Elapsed time: 2.0160 seconds
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
Block select Lisp needed...
« Reply #31 on: August 27, 2004, 09:23:39 AM »
Wow, slower? Hmmm
Ok, I'll bite the dust :D

Thanks Mark

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Block select Lisp needed...
« Reply #32 on: August 27, 2004, 09:45:32 AM »
Just to make sure I ran it again, without closing the dwg, and the results ..........
Code: [Select]

Command: (gc)
nil

Command:
Command: (LOAD "D:/home/src/AutoLisp/Working/chg-blk-to-lay.lsp") ATTLAY


Command: (attlay)
Elapsed time: 3.2340 seconds

Command: change

Select objects: Specify opposite corner: 2500 found

Select objects:
Specify change point or [Properties]: p

Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]: la

Enter new layer name <0>: blocks

Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]:

Command: (gc)
nil

Command: (gbwa)
Elapsed time: 2.1410 seconds
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
Block select Lisp needed...
« Reply #33 on: August 27, 2004, 10:14:57 AM »
Quote from: Mark Thomas
Just to make sure ...

Yeah right .. just rub it in   :lol:

JohnK

  • Administrator
  • Seagull
  • Posts: 10626
Block select Lisp needed...
« Reply #34 on: August 27, 2004, 10:18:04 AM »
So does that mean USA takes the gold?

(Pthhhht! "Denmark" ...like they even had a chance?!")
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

SMadsen

  • Guest
Block select Lisp needed...
« Reply #35 on: August 27, 2004, 10:20:16 AM »
Oh USA always think they are entitled to the gold, whether they deserve it or not .. didn't you know?  :twisted:

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Block select Lisp needed...
« Reply #36 on: August 27, 2004, 10:22:15 AM »
It would be interesting to see how well VBA did on this? Any takers ..................
TheSwamp.org  (serving the CAD community since 2003)

JohnK

  • Administrator
  • Seagull
  • Posts: 10626
Block select Lisp needed...
« Reply #37 on: August 27, 2004, 10:26:06 AM »
Pthhht! 'Knew it', Hell that expectation comes second nature by now.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

SMadsen

  • Guest
Block select Lisp needed...
« Reply #38 on: August 27, 2004, 10:36:05 AM »
Quote from: Se7en
Pthhht! 'Knew it', Hell that expectation comes second nature by now.

Likewise :D

daron

  • Guest
Block select Lisp needed...
« Reply #39 on: August 27, 2004, 11:58:28 AM »
Quote from: SMadsen
Oh USA always think they are entitled to the gold, whether they deserve it or not .. didn't you know?  :twisted:


I thought that was Russia. I'm surprised they'd been so well behaved about it this year.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Block select Lisp needed...
« Reply #40 on: August 27, 2004, 12:00:03 PM »
Ok folks you asked for it......

My testing results on a drawing with .....

one block "block1" , 10000 insertions
three attributes, each with a value
2500 blocks had one value with an "e" or "E"

(attlay)
2.1870 seconds
(gbwa)
2.0641 seconds
VBA code below
0.5939 seconds

BUWAHAHAHAHAHAHAHAHAHA

Code: [Select]

Sub ChBlLayer()
 Dim SS As AcadSelectionSet
 Dim ATTS As Variant
 Dim Code As Variant
 Dim Data As Variant
 Dim GCode(1) As Integer
 Dim GData(1) As Variant
 Dim BRef As AcadBlockReference
 Dim STime As Variant
 Dim ETime As Variant
 STime = TimeIt
 
 GData(0) = "INSERT"
 GData(1) = 1
 GCode(0) = 0
 GCode(1) = 66
 
 Code = GCode
 Data = GData
 
 Set SS = ThisDrawing.SelectionSets.Add("test2")
 SS.Select acSelectionSetAll, , , Code, Data
 For Each BRef In SS
  ATTS = BRef.GetAttributes
  For X = 0 To UBound(ATTS)
  If InStr(1, ATTS(X).TextString, "e", 1) > 0 Then
   BRef.Layer = "0" 'put me on this layer
   X = UBound(ATTS) + 1
  End If
  Next X
 Next BRef
 SS.Delete
 ETime = TimeIt
 MsgBox ETime - STime & " Seconds"
End Sub
Function TimeIt()
 Dim CTIME As Variant
 CTIME = ThisDrawing.GetVariable("MILLISECS")
 TimeIt = CTIME / 1000
End Function
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

SMadsen

  • Guest
Block select Lisp needed...
« Reply #41 on: August 27, 2004, 12:34:49 PM »
What's that? TimeIt = CTIME / 10000  ?

Oh, you edited it!  :twisted:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Block select Lisp needed...
« Reply #42 on: August 27, 2004, 01:26:44 PM »
nope ... never did...
just accept defeat with a grin ...
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