Results 1 to 8 of 8

Thread: insert block with object DBX

  1. #1
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default insert block with object DBX

    I have written a VBA routine using object DBX that inserts issue information onto the border sheet. It works well and is super fast, with one exception. The attributes of the block are justified middle center. Unfortunately, they loose their justification when inserted by oDBX.

    Here's a portion of the code:

    Code:
    Set BlockReference = oDBX.PaperSpace.InsertBlock(Ipt, IssueBlock, 1#, 1#, 1#, 0#)
        'BlockReference.Update
        For Each Attrib In BlockReference.GetAttributes
        With Attrib
            Select Case UCase(.TagString)
                Case "REV"
                    .TextString = IssueFields(0)
                Case "DESCRIPTION"
                    .TextString = IssueFields(1)
                Case "DATE"
                    .TextString = IssueFields(2)
                Case "DWN"
                    .TextString = IssueFields(3)
                Case "CHKD"
                    .TextString = IssueFields(4)
                Case "APD1"
                    .TextString = IssueFields(5)
                Case "APD2"
                    .TextString = IssueFields(6)
            End Select
        End With
        Next Attrib
    The block update is commented out because it appears to have no effect on the insertion.

    Attached is a snapshot of the result. The first three issues were inserted manually, the fourth by my program. The real irony is that if I open the file in Acad and click the new block to edit it, then close the edit, the attributes jump into position. I suspect the problem is that oDBX can't deal with the justification positions.

    Any ideas for workarounds? This program is to update over 1100 sheets, which currently takes about 4 days of manual labor!
    Attached Images Attached Images
    Last edited by MikeJarosz; 2008-01-08 at 05:15 PM.

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,416
    Login to Give a bone
    0

    Default Re: insert block with object DBX

    Without a the graphics editor loaded, there's certain calculations that obdx just can't do. Why not move this part to a different process that doesn't use obdx. You can still automate it just the same and it would only be slightly slower.
    C:> ED WORKING....


    LinkedIn

  3. #3
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Re: insert block with object DBX

    Shouldn't the visual appearance of the attributes correct themselves when the file is subsequently opened in Acad?

    Like I mentioned above, the attributes do fix themselves if I open and close block edit in Acad, but this action requires user response and is useless in a batch processor.

    One of the attractions of using DBX is the fact that these drawings are stuffed full of xrefs, some of which come from a remote office over a Steelhead connection. With no xrefs to load, the whole process flies....
    Last edited by MikeJarosz; 2008-01-08 at 08:22 PM.

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,416
    Login to Give a bone
    0

    Default Re: insert block with object DBX

    Quote Originally Posted by MikeJarosz View Post
    Shouldn't the visual appearance of the attributes correct themselves when the file is subsequently opened in Acad?
    That is standard behavior for atts, they don't move.

    A couple of other options:
    Use BATTMAN, then the SYNC button to home the atts.
    Change the tb to use all left justified atts. All justifications other than Left, require coordinate system calcs to figure out the AlignmentPoint property.
    Last edited by Ed Jobe; 2008-01-08 at 08:46 PM.
    C:> ED WORKING....


    LinkedIn

  5. #5
    Member
    Join Date
    2007-08
    Posts
    2
    Login to Give a bone
    0

    Default Re: insert block with object DBX

    I have noticed this similar shifty attribute behaviour. I find sometimes it is even caused by the block editor. The best solution I have found is to "edit block in place" and close either with or without saving. Both seem to correct this shiftyness.

    Perhaps you can add the afore mentioned process to your code in the form of a LISP or script to run after the update and before you save and close.

    Of course, this comes likely well after you have already solved the issue. But thought I'd put in my 2 cents, just in case.

  6. #6
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: insert block with object DBX

    Quote Originally Posted by erikjenson View Post
    Perhaps you can add the afore mentioned process to your code in the form of a LISP or script to run after the update and before you save and close.
    You cannot run LISP or scripts in an ObjectDBX document. There is no context for such a thing in just the database.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  7. #7
    Woo! Hoo! my 1st post
    Join Date
    2014-12
    Posts
    1
    Login to Give a bone
    0

    Default Re: insert block with object DBX

    Is there any solution to this thread? I'm struggling with the exact same problem these days. ATTSYNC and BATTMAN cannot be run on ODBX-objects it seems, and I'd really love to find a way to upgrade the remote sheets without opening them?

  8. #8
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: insert block with object DBX

    Quote Originally Posted by hansmartineikerol684707 View Post
    Is there any solution to this thread? I'm struggling with the exact same problem these days. ATTSYNC and BATTMAN cannot be run on ODBX-objects it seems, and I'd really love to find a way to upgrade the remote sheets without opening them?
    Welcome to AUGI.

    If you need to execute either LISP, Script, .NET code within a drawing - without opening said drawing in the main application's Editor - then you'd need to use Core Console in 2013+.

    Cheers



    Thread officially zombified.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Replies: 9
    Last Post: 2017-02-18, 12:12 AM
  2. Insert a Tool Palette Block While Editing a Block or Xref.
    By Wish List System in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2013-10-07, 04:53 PM
  3. Block Insert - Right Click Block Open Drawing
    By Texan1 in forum ACA Wish List
    Replies: 1
    Last Post: 2011-11-26, 04:38 AM
  4. Replies: 19
    Last Post: 2006-03-14, 05:06 PM

Posting Permissions

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