Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modify P&ID Drawing properties - metadata?

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
djwebb
2030 Views, 12 Replies

Modify P&ID Drawing properties - metadata?

Greetings community,

I am about to replicate 149 P&ID's as part of a Plant3D sub-project, where all the replicated drawings will require their metadata to be changed.  The standard way is to right click on a drawing within the project, select properties, and make required changes.  While this is not a big deal, I would like to be able to do this in a batch format.  Does anyone have any ideas or solutions on how to do this in batch format?

 

FYI,  I currently have 4 key drawing property fields that affect the tagging of various items within the P&ID.

 

Regards,

Doug Webb

12 REPLIES 12
Message 2 of 13
George.Endrulat
in reply to: djwebb

I'll preface this with: It's an answer, but not one you'll like.

 

Firstly there is no command line way to change drawing properties like in the drawing properties dialog box (when you right click a drawing --> properties).  I have checked quite a bit, if someone does know a way, please let me know.  If there was a way then you could easily use wscript (www.lee-mac.com) to automate just about anything, including calling lisp commands on every drawing in a directory.

 

But, as I've said, there's no command line way to do that through autocad.

 

So if you really want to automate the changes, without having to open each drawing, you'll have to manually run a sql command on the ProcessPower.dcf --> PnPDrawings table.  This isn't for the faint of heart.  And you generally run the risk of corrupting your project data, losing data, making children cry, etc.

 

I recommend SQLite Expert Personal for editing the dcf file.  It works.

George

If my post offers a solution, please click "Accept as Solution"
Message 3 of 13
quentin.contreras
in reply to: djwebb

I am not aware of an automated method of doing this, besides from the manual process you mentioned.

 

I have passed your forum thread to the general AutoCAD Visual LISP, AutoLISP and General Customization for any addtional feedback as well.

If my post answers your question, please mark it as an Accepted Solution, so that others can find answers quickly!



Quentin Contreras
Technical Support Specialist


Message 4 of 13

You can try this method:

 

create a standard block definiton to be used in all of these drawings.

Create fields into the block attribute definitions

Attach xdata into these fields via lisp

Use script to insert and read/write/modify xdata on these blocks, across your dwgs.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 5 of 13
djwebb
in reply to: George.Endrulat

Thanks for pointing out the needle in the haystack Georgeendrulat, I will give this a try on a sample project, so as not to have any tearful children..
Message 6 of 13
djwebb
in reply to: bhull1985

bhull1985, thanks for that very creative solution!, I will give it a try, and let you know how it goes. Will have to go up a bit of a learning curve first.
Message 7 of 13
bhull1985
in reply to: djwebb

Glad I could help.

Please let me know how it goes or if you have any questions as to portions of your code.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 8 of 13
George.Endrulat
in reply to: bhull1985

bhull1985, 

 

I don't want to assume that your answer is based on non-plant 3d.  But it seems to be.  If you have used plant 3d (p&id), then you'd know that the metadata in question is resident within a .dcf sqlight3 database, not within the drawings themselves.  And manipulating this information via drawing, isn't an ability baked into autocad outside of the autocad plant3d project manager.  I would think it's possible via the plant3d sdk / p&id sdk api, but even that is just manipulating a table within the external database.  You can one-way reference the project properties / drawing properties as fields within a drawing, but this is sadly one way, changes will not be updated in the database.

 

This is all based on my findings after working with plant 3d (p&id) for a couple of years now, I might be wrong, but I've looked into the problem more than once myself.  Like most issues with plant3d (p&id), it's a shortcoming that probably will have no remedy, sooner or later.

 

If your solution does work in plant 3d (p&id), then that is amazing, and maybe things have changed in plant 3d 2015 that I'm not aware of, but I doubt it.

George

If my post offers a solution, please click "Accept as Solution"
Message 9 of 13
bhull1985
in reply to: George.Endrulat

Yes true, I just assumed Plant3d would have metadata/xdata in the same manner as vanilla cad.

But perhaps that isn't the case.

Regardless, I would give it a shot if the OP has no other decent options.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 10 of 13
djwebb
in reply to: George.Endrulat

Thanks again for this solution georgeendrulat.  I opened up the table using the recommended SQLite Expert Personal, changed the record and verified the change back in the drawing.  I don't have the expertise to create a sql command (yet), but at least knowing how the wires are connected is good knowledge.

I was under the impression that the data transfer was always one way, ie: the db always synced to the drawings, and drawings would never sync to the db.

I was hoping that I would be able to run a quick  "export and import" on this data from the Data Manager, but I think that because this drawing data is visible as report (document registry), that is why I am unable to export - modify, then import the changes... 

Message 11 of 13
George.Endrulat
in reply to: djwebb

I was under the impression that the data transfer was always one way, ie: the db always synced to the drawings, and drawings would never sync to the db.

 

Many things are synced back and forth from the drawings and the database, a whole host of information, but sadly the drawing properties are one of the few things that are one way, as you've seen.  Any annotation within the drawing places from a p&id object has a two way link, as an example an equipment tag has the ability to: be assigend (changed), edited via double click, changed via script, etc and it will back-propogate into the database if done correctly, in essense anything that can be changed via the properties palette for an object.

 

I was hoping that I would be able to run a quick  "export and import" on this data from the Data Manager, but I think that because this drawing data is visible as report (document registry), that is why I am unable to export - modify, then import the changes... 

 

Sadly, drawing properties aren't exportable via the data manager / import export settings / reports or just about any other way I can think of.  But I was thinking of a workaround, there are many programs out there to assign macros to keyboard/mouse commands to reproduce actions (outside of autocad), these have the potential to automate changes, but it'd be essentially not worth the time to set it all up when you can just do the sql command as I previously mentioned.

 

I'm glad I could help.

 

The only thing I ask in return is that you answer a question or two in the p&id forum for someone else.

George

If my post offers a solution, please click "Accept as Solution"
Message 12 of 13
-TOMMER-
in reply to: George.Endrulat

Why is this reply marked as solution? This is not solution. This is only recapitulation that it is not possible. But why? I want edit document properties by data manager report.

Message 13 of 13
George.Endrulat
in reply to: -TOMMER-

I agree and I don't think it should be a solution.

What I've done here to be able to modify drawing properties is to move all but the most essential properties to excel and I've linked that excel via PLANTXDBMANAGER as a datasource which feeds properties on a property holder (revision block, notes block, title block, etc) So I can now modify multiple drawing properties at once.

George

If my post offers a solution, please click "Accept as Solution"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost