Jump to content

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


wakibd

Recommended Posts

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 ) + "

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...