NEW: Welcome to the Rhino 6 version of this page! Looking for the older Rhino 5 version?

List AutoCAD Export Schemes

Demonstrates how to build a list of AutoCAD export schemes using RhinoScript.

VBScript

Option Explicit

Function GetAcadExportSchemes()
  Const HKEY_CURRENT_USER = &H80000001

  Dim objReg, strComputer, strKey, arrSubKeys
  strComputer = "."
  strKey = "Software\McNeel\Rhinoceros\4.0\Scheme: Default\Plug-ins\39a88493-9e97-4f15-bd62-ad25896a2632\Settings"

  On Error Resume Next   
  Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
  If Err.Number = 0 Then
    Call objReg.EnumKey(HKEY_CURRENT_USER, strKey, arrSubKeys)
  End If

  If IsArray(arrSubKeys) Then
    GetAcadExportSchemes = Rhino.SortStrings(arrSubKeys)
  Else
    GetAcadExportSchemes = Null
  End If

End Function