Skip to content

How to add your own script?

Damian Krzemiński edited this page Dec 17, 2018 · 2 revisions

Getting started

In DKTools you can add your own python script and application will add it to its pulldown buttons.
To do so you need to register your scripts in the XML configuration file.
You can find the XML configuration file in the folder with the application:
C:\ProgramData\Autodesk\Revit\Addins\2017\DKTools\PythonScripts\ScriptsSettings.xml

Read DKTools Python framework to get to know how it works.

ScriptsSettings.xml

Following you can see a block of xml code with script registration:

  <Script>
    <CommandName>Memo1_Write</CommandName>                   <!-- obligatory -->
    <NameOnRibbon>Memo 1: Write</NameOnRibbon>               <!-- obligatory -->
    <ScriptPath>Memo\Memo1\Memo1_Write.py</ScriptPath>       <!-- obligatory -->
    <ParentButton>Selection</ParentButton>                   <!-- obligatory -->
    <ToolTip>Write current selection to memory 1</ToolTip>   <!-- optional -->
    <ImageUri>Images\brain-blue.png</ImageUri>               <!-- optional -->
  </Script>