Upgrading Add-in Project in Ver. 7/Ver. 8 Format to Ver. 12 Format


To use add-in projects created in RootPro CAD Ver. 7/Ver. 8 in RootPro CAD Ver. 12, it is necessary to upgrade the projects with the following procedures.

  1. Start up RootPro CAD Professional, and click [Add-ins] - [Launch Visual Studio] menus.
    Visual Studio will start up.
  2. Click [File] - [Open project] menus in Visual Studio to select a solution file (.sln) for an add-in project.
  3. Click [Project] - [(ProjectName) property] menu to display the setting screen for the project.
  4. Modify [Target framework:] on [Apps:] to [.NET Framework 4.6.2].
    Supplemental
  5. Delete a script in [Post-Build Event Command Line] on [Build Events...] and modify it to the following.
    cscript "$(ProjectDir)InstallAddIn.js" "$(TargetPath)" "$(TargetName)"
    Supplemental
    If there is already a command with the same details, you do not have to modify it.
  6. Select [Start External Program] on [Debug], and click [...] on the right.
    [Select File] dialog box will be displayed.
  7. Select RootProCAD.exe in a folder RootPro CAD is installed, and click [Open].
    Normally, the path is "C:\Program Files\RootPro CAD 12 Professional\RootProCAD.exe".
  8. Double click InstallAddIn.js on the Solution Explorer to open the file, and modify to the following codes.
    Select and delete all of the current codes, then copy and paste the following codes.
    if (WScript.Arguments.length != 2) WScript.Quit(-1);
    
    var wshShell = new ActiveXObject("WScript.Shell");
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    
    var docPath = wshShell.SpecialFolders("MyDocuments");
    var addInsPath = fso.BuildPath(docPath, "RootPro CAD\\AddIns");
    
    var sourcePath = fso.BuildPath(WScript.Arguments(0), "*");
    WScript.Echo(sourcePath);
    var targetPath = fso.BuildPath(addInsPath, WScript.Arguments(1));
    WScript.Echo(targetPath);
    
    var command = "xcopy \"" + sourcePath + "\" \"" + targetPath + "\\\" /e /y"
    WScript.Echo(command);
    var exec = wshShell.Exec(command);
    
    while (exec.Status == 0) WScript.Sleep(100);
    
    var execStat = "";
    while (!exec.StdOut.AtEndOfStream) {
        execStat += exec.StdOut.ReadLine();
        execStat += "\n"
    }
    WScript.Echo(execStat);
    
    WScript.Quit();

For C# add-in projects

  1. Open [References], select RootPro.RootProCAD.Library.v8, and click [Delete] on the right-click menu.
    Supplemental
    For add-in projects of Ver. 7, select RootPro.RootProCAD.Library.v7 and delete it.
    For add-in projects of Ver. 6 or lower, select RootPro.RootProCAD.Library.v5 and delete it.
  2. Click [Add Reference] on the right-click menu to display the Reference Manager.
  3. Click [References] button on the bottom right to display "RootPro CAD\References" folder in document folder.
  4. Select RootPro.RootProCAD.Library.dll in the folder, and click [Add].
  5. Click [OK] button to close the Reference Manager.
  6. Click [File] - [Save All] menus.

For VB add-in projects

  1. Click [Project] - [(ProjectName) property] menus to display the setting screen for the project.
  2. Click [References] to display the list of references.
  3. Select RootPro.RootProCAD.Library.v8 in the reference list, and click [Delete] button.
    Supplemental
    For add-in projects of Ver. 7, select RootPro.RootProCAD.Library.v7 and delete it.
    For add-in projects of Ver. 6 or lower, select RootPro.RootProCAD.Library.v5 and delete it.
  4. Click [Add] button to display the Reference Manager.
  5. Click [References] button on the bottom right to display "RootPro CAD\References" folder in document folder.
  6. Select RootPro.RootProCAD.Library.dll in the folder, and click [Add].
  7. Click [OK] button to close the Reference Manager.
  8. Click [File] - [Save All] menus.

Build of add-in projects (C# and VB)

  1. Select [Build] - [Build Solution] menus.
    Build will be executed, and an add-in file (.dll) will be created.
  2. Select [Debug] - [Start debugging] menus.
    Professional will start up, so check that the add-in operates correctly.
Supplemental
Add-ins are only used in RootPro CAD Professional. RootPro CAD Free cannot use these functions.

Related topics