Results 1 to 10 of 10

Thread: Schedule Table Style with VBA

  1. #1
    All AUGI, all the time buzz's Avatar
    Join Date
    2007-10
    Location
    Tucson, Arizona
    Posts
    613

    Default Schedule Table Style with VBA

    Anyone use VBA in their Schedule Table Styles with any sucess?

    I am trying to insert a block into a Formula Column using GetObject

    See screenshot...

    With this formula, what happens is when the schedule updates it closes the current drawing and opens TEST.dwg in a new drawing, then as soon as that drawing is opened, it crashes. So maybe there is something like:

    GetObject("C:\\TEST.dwg", this.drawing) ??

    -Buzz
    Attached Images Attached Images
    Last edited by buzz; 2008-07-16 at 10:49 PM.
    no trophy, no flowers, no flashbulbs, no line,
    he's haunted by something he cannot define...
    humble genius

  2. #2
    Active Member
    Join Date
    2002-06
    Location
    Portland, OR
    Posts
    83

    Default Re: Schedule Table Style with VBA

    The schedules actually use vbscript which looks very similar but is different.

    Take a look here - The Architect's Desktop blog - ADT Schedule Resources. David Koch is awesome at this and is actually a moderator over on the ACA forums.

    As for using getobject, I have found that it is terribly slow since it is working out of process. We have tried it on a number of different occasions and every time it hits the users in production, we have to find another way because it bogs modification/schedule update to a stand-still.

    I know this isn't the fish...but I am trying to hand you the net...and possibly point out a few holes.

    Hope this helps.

  3. #3
    All AUGI, all the time buzz's Avatar
    Join Date
    2007-10
    Location
    Tucson, Arizona
    Posts
    613

    Default Re: Schedule Table Style with VBA

    Thanks for the reply Ben, I will go check it out...

    -Buzz
    no trophy, no flowers, no flashbulbs, no line,
    he's haunted by something he cannot define...
    humble genius

  4. #4
    Active Member
    Join Date
    2008-05
    Location
    Boston
    Posts
    65

    Default Re: Schedule Table Style with VBA

    Ever have any luck with this? I could've sworn I came across how to do this in an ATP or something by David Koch, but of course cannot find it now.
    I'm trying to add a column to a schedule table that checks a property, and if it matchs, will add a specific block.

    This is what I've got so far in a formula as the source for a property.

    Select Case "[SpaceType_BOMA]"
    Case "Occupant Areas"
    Set BlockRefObj = ThisDrawing.ModelSpace.InsertBlock(0#, "oa-color", 1#, 1#, 1#, 0)
    Case Else
    End Select

    Of course, I don't want the block in model space, but in the schedule table, so I'm still fumbling with getting the right info to make this work.
    Thanks.

  5. #5
    Forum Manager, Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    4,776

    Default Re: Schedule Table Style with VBA

    Quote Originally Posted by elmoleaf View Post
    Of course, I don't want the block in model space, but in the schedule table, so I'm still fumbling with getting the right info to make this work.
    Thanks.
    So, you're saying you want to INSERT the block in a cell of a table?
    C:> ED WORKING....

  6. #6
    Active Member
    Join Date
    2008-05
    Location
    Boston
    Posts
    65

    Default Re: Schedule Table Style with VBA

    In an ACA schedule table, not a regular table.

  7. #7
    Forum Manager, Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    4,776

    Default Re: Schedule Table Style with VBA

    The type of table was not the question. Are you trying to INSERT (as your code shows) or merely schedule an existing block. Perhaps both, insert a block and then schedule it? Before you can figure out how to do something, you need to be clear on what to do.
    C:> ED WORKING....

  8. #8
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    482

    Default Re: Schedule Table Style with VBA

    so you need the Graphic Property of block xx to display for Space type yyy

    no need to program just set up
    1. each space type sould have it oun style
    2. add Style Property set Applies to spaces
    3. add a graphic property to the spaces style propertyset
    4. Attach the Propety set to space style yyy
    5. Set Display to block xx
    6. add the Graphic proerty to your Schudel
    7. Done
    Note:
    update to 2011
    I am using ADT 2007 08/06/2008

    PS. If you use any Code I post or Down Load Attachment I would like to know if it was helpful. So please post reply to this thread, on how you use the code or down load. Thank You

  9. #9
    Active Member
    Join Date
    2008-05
    Location
    Boston
    Posts
    65

    Default Re: Schedule Table Style with VBA

    Quote Originally Posted by jwanstaett View Post
    so you need the Graphic Property of block xx to display for Space type yyy

    no need to program just set up
    1. each space type sould have it oun style
    2. add Style Property set Applies to spaces
    3. add a graphic property to the spaces style propertyset
    4. Attach the Propety set to space style yyy
    5. Set Display to block xx
    6. add the Graphic proerty to your Schudel
    7. Done
    Yes, this is what I'm trying to accomplish. I have a separate display theme with colors that I'd like to integrate directly into my area schedule.
    I added the graphic property as above etc, but the block in my schedule doesn't match the original (see attached). I have a small green square that gets rescaled smaller and color changed to magenta.
    I can't find any means to override the color and scale in my schedule style.
    Perhaps rather than a block file I should use image file option for the graphic property? I'll give that a try and let you know. Thank you.
    Attached Images Attached Images

  10. #10
    Active Member
    Join Date
    2008-05
    Location
    Boston
    Posts
    65

    Default Re: Schedule Table Style with VBA

    Ok, I see I can override the cell format for a column in my schedule table style to control the block size.
    I can control the layer for the block via a layer key. But that's a bit roundabout and requires adding custom layer keys to put my custom color blocks all on their own layers.

    The option to use an image file instead of a block file allows the item to retain its original color. But this requires creating separate image files outside of the cad drawing, and the color quality doesn't match what is in the drawing.
    I really don't understand why when I use a block that has hard-coded colors in it, the schedule table treats it like a block that's drawn on layer 0 (colors get transformed to match that of the table).

    Guess I stick with two separate tables, rather than integrating them.
    This is all being done in Autocad for Architecture 2010, by the way. Thank you.

Similar Threads

  1. Filter tab in schedule table style
    By m.yamani in forum ACA Wish List
    Replies: 3
    Last Post: 2009-01-21, 03:01 PM
  2. schedule table style - trouble updating template
    By rick.rivera in forum ACA General
    Replies: 2
    Last Post: 2008-01-21, 04:59 PM
  3. Replies: 1
    Last Post: 2006-12-12, 06:36 AM
  4. Replies: 1
    Last Post: 2006-10-13, 04:58 PM
  5. Can a Schedule Table be converted to Table
    By tomdillenbeck in forum ACA General
    Replies: 6
    Last Post: 2005-09-28, 12:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •