Author Topic: Need something else than attributes extraction.  (Read 2935 times)

0 Members and 1 Guest are viewing this topic.

Zykl0

  • Guest
Need something else than attributes extraction.
« on: May 21, 2009, 09:24:15 AM »
Hello all,

I am currently working on something for my boss.
Basically this is a excel file where we going to merge a lot of document together and information about each project.
I discovered a lisp file able to read specific cell in excel (READCELL) and another one able to write a specific cell in a specific worksheet (PUTCELL).

What i need:
 -I would like to be able to extract each block quantity into specific cell in excell using the command PUTCELL i have.
   ;   Syntax:  (PutCell StartCell$ Data$) or (PutCell StartCell$ DataList@)
   ;   Example: (PutCell "A1" (list "GP093" 58.5 17 "Base" "3'-6 1/4\""))


Condition:
-Many of our block are dynamic with different name *Ublahblah , impossible to count, But i'm going to add invisible attribute with the name of the item in each block, for better calculation later.

-The zone of the block selection should be generated  automatically, to prevent clone of the same block (counted twice) like the same detail with 2-3 different view. i'm going to design each floor above X + Z axis (meaning top right of the X-Y icon in model space), and every detail under X axis (X-1 to 500 etc.) this way the block attribute extraction selection does not count extra block.


Begging:
Can someone explain me how to do this with example please? my Lisp scripting is limited to adjusting other people script to fit my needs, but i cannot find something similar actually :)

thank you very very much for your help!

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Need something else than attributes extraction.
« Reply #1 on: May 21, 2009, 11:05:27 AM »
When working with dy blocks, you can get the name of the original block by two ways.  The easier way is to use ActiveX.  With AX there is a property called ' EffectiveName ' which is the orig. name of the block.  If you want to do a list of blocks that are inserted, then you are going to have to just grab all blocks, and the step through them making a list of their quantities associated with the EffectiveName of each one.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need something else than attributes extraction.
« Reply #2 on: May 21, 2009, 11:21:22 AM »
I think this will allow you to get all blocks that have a z-axis value of 0.0
Code: [Select]
(setq ss (ssget "X" '((0 . "INSERT")(-4 . "*,*,=")(10 0.0 0.0 0.0))))You may want to confine the blocks selected to current space by using this
Code: [Select]
(setq sset (ssget "X" (list (0 . "INSERT")(-4 . "*,*,=")(10 0.0 0.0 0.0)(cons 410 (getvar "ctab")))))
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: 7529
Re: Need something else than attributes extraction.
« Reply #3 on: May 21, 2009, 11:38:45 AM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Zykl0

  • Guest
Re: Need something else than attributes extraction.
« Reply #4 on: May 22, 2009, 11:57:15 AM »
This should help you with the counting: http://www.theswamp.org/index.php?topic=28660.msg342865#msg342865

This is interesting but on mostly every different project i have error,

; error: bad argument type: stringp nil

some block inside the drawing might be bugged.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Need something else than attributes extraction.
« Reply #5 on: May 22, 2009, 12:35:56 PM »
This should help you with the counting: http://www.theswamp.org/index.php?topic=28660.msg342865#msg342865

This is interesting but on mostly every different project i have error,

; error: bad argument type: stringp nil

some block inside the drawing might be bugged.

I updated the code...it had a bug  :lol:

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Zykl0

  • Guest
Re: Need something else than attributes extraction.
« Reply #6 on: May 22, 2009, 01:13:36 PM »
Thank you Ron, this is a very useful tool you made,

I will try to adjust this to export this to my excel cell!