Jump to content
wakibd

Updating a specific attribute inside a folder of AutoCAD drawings using RealDWG from

Recommended Posts

wakibd

Could please anyone know how to connect/run/load this proggram with auto cad 2006 or 2008

 

1 using Autodesk.AutoCAD.DatabaseServices;

2 using Autodesk.AutoCAD.Runtime;

3 using System.Reflection;

4 using System.IO;

5 using System;

6

7 [assembly: SecuredApplication(

8 @"THIS IS AN OBJECTDBX ™ VERSION 2007 CLIENT LICENSE FOR THE EXCLUSIVE USE OF Kean Walmsley. YOUR USE OF OBJECTDBX™ IS GOVERNED BY THE SOFTWARE LICENSE INCLUDED IN THE PRODUCT. USE OF THIS SOFTWARE IN VIOLATION OF THE SOFTWARE LICENSE IS A VIOLATION OF U.S. AND/OR INTERNATIONAL COPYRIGHT LAWS AND TREATIES AND YOU MAY BE SUBJECT TO CRIMINAL PENALTIES FOR SUCH USE.",

16

17 namespace AttributeUpdater

18 {

19 class Program

20 {

21 #region RealDWG

22 class MyHost : HostApplicationServices

23 {

24 private string SearchPath(string fileName)

25 {

26 // check if the file is already with full path

27 if (System.IO.File.Exists(fileName))

28 return fileName;

29

30 // check application folder

31 string applicationPath =

32 Path.GetDirectoryName(

33 Assembly.GetExecutingAssembly().Location

34 );

35 if (File.Exists(applicationPath + "\\" + fileName))

36 return applicationPath + "\\" + fileName;

37

38 // search folders in %PATH%

39 string []paths =

40 Environment.GetEnvironmentVariable(

41 "Path").Split(new char[]{';'}

42 );

43 foreach (string path in paths)

44 {

45 // some folders end with \\, some don't

46 string validatedPath

47 = Path.GetFullPath(path + "\\" + fileName);

48 if (File.Exists(validatedPath))

49 return validatedPath;

50 }

51

52 // check the Fonts folders

53 string systemFonts =

54 Environment.GetEnvironmentVariable(

55 "SystemRoot"

 

56 ) + "

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×