.NET

Reply
Active Member
dominicthoppil
Posts: 9
Registered: ‎09-27-2012
Message 1 of 4 (204 Views)

Unique identifier to a drawing file

204 Views, 3 Replies
01-14-2014 07:52 AM

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

Distinguished Mentor
gasty1001
Posts: 582
Registered: ‎04-11-2010
Message 2 of 4 (199 Views)

Re: Unique identifier to a drawing file

01-14-2014 08:50 AM 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

 

 

Valued Mentor
jeff
Posts: 338
Registered: ‎05-12-2009
Message 3 of 4 (176 Views)

Re: Unique identifier to a drawing file

01-14-2014 03:25 PM in reply to: gasty1001

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
*Expert Elite*
dgorsman
Posts: 5,698
Registered: ‎10-12-2006
Message 4 of 4 (155 Views)

Re: Unique identifier to a drawing file

01-15-2014 07:21 AM in reply to: gasty1001

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.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.