Author Topic: Update Attributes With ObjectDBX  (Read 2152 times)

0 Members and 1 Guest are viewing this topic.

Vince

  • Newt
  • Posts: 55
Update Attributes With ObjectDBX
« on: March 19, 2010, 11:52:23 AM »
Hello Swamp Members,

I am new to ObjectDBX and have been trying to create an application that would update the title block attributes by adding new information to the revision block. However, I do not know how to accomplish the following task. Not only do I want to add information to an existing revision block on the drawing but I would want the routine to find the next available attribute definition and fill in the Revision Number - Date - Description. Some drawing sheets would be issued for the first time and thus the revision information would go into revision number one but, other sheets might have been issued 3 times before so, on those sheets, the next available attribute definition would be number four. I have attached the revision block drawing (Title-Rev.dwg) that is inserted on all of the drawing sheets. You will see that there are 3 attribute definitions (N1 = revision number  -  D1 = revision date  -  R1 = revision description) per revision row, and there are many rows of attribute definitions with each row being sequentally numbered (first row = N1 - D1 - R1, second row = N2 - D2 - R2, third row = N3 - D3 - R3, etc.).

Can this be done with ObjectDBX....??  If so, is there an example to demonstrate how to have the routine fine the next available attribute definition....?? We constantly update the revision blocks of large numbers of drawings and this would be very helpful.

Any assistance would be appreciated.....!


Regards,
Vince

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Update Attributes With ObjectDBX
« Reply #1 on: March 19, 2010, 11:57:04 AM »
It is do-able. However, ObjectDBX will screw up the justification of the attributes if you mod them, so a less sexy, but more practical solution would be to batch the operation -- as you'd have to open the drawings to fix the justification problems anyway (moving the parent entity from 0,0 to 0,0 while in the drawing editor will 'fix' the attribs if memory serves).

/quick opinion
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Update Attributes With ObjectDBX
« Reply #2 on: March 19, 2010, 12:58:15 PM »
I had a go at making a program to do that, (both extracting and editing), and included a function to "re-justify" attributes - not ideal, but quicker than batch.

http://www.theswamp.org/index.php?topic=29124.0

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Update Attributes With ObjectDBX
« Reply #3 on: March 19, 2010, 04:47:16 PM »
From the way-out-there club:

- use ODBX to update XRECORDS in each drawing with the appropriate values; attach the XRECORDS to the title blocks if you have more than one per drawing
- create a LISP that auto-loads at start-up, reading the XRECORDS into global variables
- add fields to the block attributes that point to the XRECORDS

Fields should retain previous values if they don't get if the start-up LISP isn't there/doesn't fire (haven't directly confirmed this though).
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Vince

  • Newt
  • Posts: 55
Re: Update Attributes With ObjectDBX
« Reply #4 on: March 29, 2010, 11:28:09 AM »
Hi Lee,

I tried your routine and it worked fine in my AutoCAD environment. Your expert skills have produced professional results....!

However, I do have a question. On our projects not all of the drawings are issued the same amount of times and some sheets will be on revision number one (#1) and other sheets might be on revision number three (#3) or four (#4), etc. There is no way for me to know ahead of time what revision number exists on each sheet without either opening each drawing or having a set of prints.

Is there a way for your routine and ObjectDBX to find the next available empty revision number and place the revision Date and Description in those attribute fields and number the revision number accordingly (#1 or #3 or #4, etc.)....??

Any assistance would be appreciated....!


Regards,
Vince


Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Update Attributes With ObjectDBX
« Reply #5 on: March 29, 2010, 02:01:51 PM »
Hi Vince,

Firstly, many thanks for your compliments, they are appreciated.

What might be easier is to create a function compatible with ObjectDBX to suit your needs and perhaps use my ObjectDBX base program to iterate your drawings, see here:

http://www.theswamp.org/index.php?topic=31827.0