Jump to content

Block Counter (Includes Dynamic Blocks)


Lee Mac

Recommended Posts

Thanks.

 

Ok, so from your error I'm guessing that:

 

(cdr (assoc 70 (tblsearch "BLOCK" <BlockName>)))

Is nil.

 

I'm not sure why this should be, as the block should always have a group 70 DXF value - are you using any 'special' blocks (non-standard)?

 

 

As a quick fix, change:

 

                   (if (zerop (logand 45 (cdr (assoc 70 (tblsearch "BLOCK" (setq n (BlockName obj)))))))
                     (setq l (assoc++ n l))
                   )

to:

 

                   (if (setq n (BlockName obj))
                     (setq l (assoc++ n l))
                   )

Link to comment
Share on other sites

  • Replies 131
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    58

  • The Buzzard

    7

  • autolisp

    5

  • piscopatos

    4

Top Posters In This Topic

Posted Images

i tried this quick fix, it doesnt give nill anymore but table comes back empty.

i dont know whether i got non standard block or not but if there is i guess those non standard blocks might have come when i installed autocad mep.

thanks for your effort lee, u r a bless to this comunity

Link to comment
Share on other sites

Lee-

 

This lisp is awesome!! The previews are great, this will help with some basic estimating too!!

 

Keep up the great work! I sure have a lot of learning to do when it comes to this stuff!

 

Kat

Link to comment
Share on other sites

Lee-

 

This lisp is awesome!! The previews are great, this will help with some basic estimating too!!

 

Keep up the great work! I sure have a lot of learning to do when it comes to this stuff!

 

Kat

 

Many thanks Kat, I'm glad you like it :)

 

Lee

Link to comment
Share on other sites

  • 4 weeks later...

Dear Sir,

Some Error on lisp please chk

See Attched file

Command: ap APPLOAD CountV1-2.lsp successfully loaded.

Command:
ø¤º°`°º¤ø  Count.lsp ~ Copyright © by Lee McDonnell  ø¤º°`°º¤ø
  ~¤~          ...Type "Count" to Invoke...            ~¤~
Command:
Command: count
Select Blocks to Count <All> :
Block Name..............................|...Count
----------------------------------------|--------
Tree-Jambhul............................|.......1
Tree-Piple..............................|.......2
Tree-Umber..............................|.......1
Tree-Wadh...............................|.......1
rpole...................................|.......1
t15b....................................|.......2
----------------------------------------|--------
Table? [Yes/No/Settings] <Yes> :
** Error: no function definition: nil **

Tree Inventary 16-12-2010.zip

Link to comment
Share on other sites

This is the first time such a bug has been reported - could you identify in the VLIDE on which line the code crashes?

 

To do such, type VLIDE at the AutoCAD command line, then:

 

 

  • Open my program (Ctrl+O)

 

  • Debug > Break on Error (ticked)

 

  • Load my program (Ctrl+Alt+E)

 

  • In AutoCAD: Run the program 'til it crashes

 

  • In VLIDE: Debug > Last Break Source

 

  • Copy/Paste the highlighted code segment here along with the relevant error message.

 

  • Reset the Error (Ctrl+R)

 

  • Untick the Break on Error (if desired).

 

Lee

Link to comment
Share on other sites

This is the first time such a bug has been reported - could you identify in the VLIDE on which line the code crashes?

 

To do such, type VLIDE at the AutoCAD command line, then:

 

 

  • Open my program (Ctrl+O)

 

  • Debug > Break on Error (ticked)

 

  • Load my program (Ctrl+Alt+E)

 

  • In AutoCAD: Run the program 'til it crashes

 

  • In VLIDE: Debug > Last Break Source

 

  • Copy/Paste the highlighted code segment here along with the relevant error message.

 

  • Reset the Error (Ctrl+R)

 

  • Untick the Break on Error (if desired).

 

Lee

 

Dear Sir,

below Line error

(
                 (if (is64Bit)
                   vla-SetBlockTableRecordId32
                   vla-SetBlockTableRecordID2
                 )
                  tObj row 0 acBlockCell
                   
                 (GetObjectID (Itemp blks block) doc)
                 t
               )

** Error: no function definition: nil **

Link to comment
Share on other sites

Ok, I would assume that the vla-SetBlockTableRecordID2 function perhaps doesn't exist in ACAD 2006 (the version displayed on your profile).

 

I'll look to update the code in future, but for now, try changing:

 

vla-SetBlockTableRecordID2

 

to

 

vla-SetBlockTableRecordID

 

 

 

Lee

Link to comment
Share on other sites

Ok, I would assume that the vla-SetBlockTableRecordID2 function perhaps doesn't exist in ACAD 2006 (the version displayed on your profile).

 

I'll look to update the code in future, but for now, try changing:

 

vla-SetBlockTableRecordID2

 

to

 

vla-SetBlockTableRecordID

 

 

 

Lee

Dear Sir,

Update code but some error

error on same line

(

(if (is64Bit)

vla-SetBlockTableRecordId32

vla-SetBlockTableRecordID

)

tObj row 0 acBlockCell

 

(GetObjectID (Itemp blks block) doc)

t

)

** Error: Too many actual parameters **

Link to comment
Share on other sites

that is very nice. how about the ability to count the view states of a dynamic block?

 

Thanks Mark, I think that question about dynamic blocks has been asked in the past - I could look through the Dynamic Block properties of the block but how does one determine which dynamic properties are view states? I need more experience with dynamic block manipulation really :oops:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...