.NET

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

Unique identifier to a drawing file

187 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

Valued Mentor
gasty1001
Posts: 450
Registered: ‎04-11-2010
Message 2 of 4 (182 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: 325
Registered: ‎05-12-2009
Message 3 of 4 (159 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,134
Registered: ‎10-12-2006
Message 4 of 4 (138 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.


You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community