.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unique identifier to a drawing file

4 REPLIES 4
Reply
Message 1 of 5
dominicthoppil
1716 Views, 4 Replies

Unique identifier to a drawing file

Hi

 

              I a trying to develop a plugin in .Net. I want to put a unique identifier to each drawing file. Because if the user has  changed the file name , i should be able to identify my original file. So i need to add some file id to each drawing file . How do i implement this ? Which is the best mechanism?  I tried it using DSOfile,but the custom attributes included is missing after saving the file.

 

 

Regards

Dominic

4 REPLIES 4
Message 2 of 5
hgasty1001
in reply to: dominicthoppil

Hi,

 

I'm not sure if exists a definitive solution to this problem, but i imagine at least 2 ways to go:

 

1.- Put some xdata in a non graphic object, like layer "0", will be difficult to find by common users, non directly selectable, and you can't get rid of layer "0"

2.-Add a digital signature to the drawing.

 

Gaston Nunez

 

 

Message 3 of 5
jeff
in reply to: hgasty1001

A .dwt basiclly is a dwg file but initiates all the timer variables and creates Guid for each document created. There is a database property

Database.FingerprintGuid which is a GUID created when a drawing is created from a dwt.

 

If you store that it should be the same for any file name change etc.., but for SaveAS you would then muliple drawings with same guid.

You can also find your answers @ TheSwamp
Message 4 of 5
dgorsman
in reply to: hgasty1001

Or, add a dictionary to the drawing with an XRecord.  Generating a GUID should give a reasonable expectation of uniqueness.  Like most solutions, this also has the problem of being removeable by those in the know.  You might want to consider a reverse-flag type system, where the *absence* of an identifier is used to identify a copy.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 5 of 5

Just one questions first how are you controlling the data once you create a UID? AutoCAD isn't a database so while you can store information in a file it is potentially useless unless you have something to lookup against, eg an SQL database. I personally stored it in the Metadata, most people don't know that they can muck this up so it was a relatively safe bet that everything would be OK. it also helped that I didn't need to open AutoCAD to view this data. I had built some code to record every drawing created by our company in an SQL database, and was then able to write other programs around it for Document Control etc.

There is a tone of .Net information available from any number of sources that could guide you with this. The best source of information I found is written by Kean Walmsley:

https://www.keanw.com/autocad_net/

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost