Jump to content

Recommended Posts

Posted

Hey all,

 

I am slowly getting the hang of writing AutoLISP and I've really appreciated everyone's input so far. I've been able to create a few lisps already that have helped out my workflow a lot!

 

For my next lisp I am a little over my head. I'm looking to create a lisp to add the length property of my blocks together for each block name. We have a block library where we can change the length of the block and we need these lengths for a Material Take Off.

 

Here's a breakdown of what I want the routine to be able to do:

 

-Look for dynamic blocks in a selection

-Find the lengths property for the blocks

-Add the lengths together for respective blocks

-Generate a report with lengths of each present block

 

Normally I would have an attempted code for this, but I really have no idea where/how to start.

 

Any help is most appreciated!

Posted

Look into my code for blocks: http://sourceforge.net/p/caddons/code/67/tree/Blocks/BlockData.LSP

 

The last 2 defuns work on a block reference and extracts/sets a particular parameter. They use the other defuns as helpers, so you'll need to look at how those work too.

 

From this you can step through a selection set of the blocks one at a time. Then if you know the param's name (or it's index) you can simply run my code on that in turn.

  • 1 month later...
Posted

Hey guys,

 

Been busy for the last little bit so no progress has been made yet. Been thinking about this one more and I think I have a slightly different approach but I still need some guidance...

 

So when I list the properties of the block in question it shows up like this:

 

 BLOCK REFERENCE  Layer: "0"
                           Space: Model space
                  Handle = 56c
      Block Name: "16 NPS PIPE"
  Anonymous Name: "*U7"
               at point, X=2294.5575  Y=1474.8554  Z=   0.0000
  X scale factor:    1.0000
  Y scale factor:    1.0000
  rotation angle:      0
  Z scale factor:    1.0000
        InsUnits: Meters
 Unit conversion: 1000.0000
 Scale uniformly: No
 Allow exploding: Yes
     [b]Pipe Length: 1000.0000[/b]
     Visibility1: Straight Pipe

 

How do I extract the pipe length information from the block?

Posted

After much searching I found out the DATAEXTRACTION command does exactly what I am looking for... thanks for your help guys!

Posted

No worries - glad you found a solution!

Thank you for reporting back :)

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...