Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

  1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

  2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here Make sure you save shortcuts.xml while Notepad++ is closed.

  3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.

To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

  1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

  2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here . Make sure you save shortcuts.xml while Notepad++ is closed.

  3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.

To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

  1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

  2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here. Make sure you save shortcuts.xml while Notepad++ is closed.

  3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.


Navigation with anchors to classes:

For this, we'll use what is called "Function List".

  1. Use the shortcut [Windows] + R to bring up the run prompt, and type in : %appdata%/notepad++ Windows Explorer will open to the folder in which you'll find functionlist.xml. This is the file you need to modify, and notepad++ must be closed when you save it. So either modify with another text editor, or modify in another location then copy paste. I suggest the latter. And make a copy of your original functionlist.xml just in case, never too safe.

  2. In the <associationmap> section, add an association

    <association userdefinedlangname="EnergyPlus-JM" id="energyplus_class"/> <association ext=".idf" id="energyplus_class"/> In the first, with "userDefinedLangName" replace "EnergyPlus-JM with whatever you named your user defined language as. (Or delete it) The section, with "ext" associates any file with the extension .idf.

  3. In the "parsers" section, add a new parser with the id "energyplus_class".

<parser id="energyplus_class" displayname="EnergyPlusClass"> <function mainexpr="^(!- =========== ALL OBJECTS IN CLASS: )[\w:]+ (===========)"> <functionname> <nameexpr expr=": [\w:]+ "/> <nameexpr expr=" [\w:]+"/> <nameexpr expr="[\w:]+"/> </functionname> </function> </parser> 4. After replacing/saving (with notepad++ closed), reopen notepad++. To see the "navigation pane", you need to activate the Function List pane by clicking on "View" in the navigation menu (top of windows) then "Function List".

To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

  1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

  2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here. Make sure you save shortcuts.xml while Notepad++ is closed.

  3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.


Navigation with anchors to classes:

For this, we'll use what is called "Function List".

  1. Use the shortcut [Windows] + R to bring up the run prompt, and type in : %appdata%/notepad++ Windows Explorer will open to the folder in which you'll find functionlist.xml. This is the file you need to modify, and notepad++ must be closed when you save it. So either modify with another text editor, or modify in another location then copy paste. I suggest the latter. And make a copy of your original functionlist.xml just in case, never too safe.

  2. In the <associationmap> section, add an association

    <association userdefinedlangname="EnergyPlus-JM" id="energyplus_class"/> <association ext=".idf" id="energyplus_class"/> association (see link to pastebin below) In the first, with "userDefinedLangName" replace "EnergyPlus-JM with whatever you named name you used for your user defined language as. language. (Or delete it) The section, with "ext" associates any file with the extension .idf.

  3. In the "parsers" section, add a new parser with the id "energyplus_class".

<parser id="energyplus_class" displayname="EnergyPlusClass"> <function mainexpr="^(!- =========== ALL OBJECTS IN CLASS: )[\w:]+ (===========)"> <functionname> <nameexpr expr=": [\w:]+ "/> <nameexpr expr=" [\w:]+"/> <nameexpr expr="[\w:]+"/> </functionname> </function> </parser> 4. "energyplus_class" (see pastebin)

  • After replacing/saving (with notepad++ closed), reopen notepad++. To see the "navigation pane", you need to activate the Function List pane by clicking on "View" in the navigation menu (top of windows) then "Function List".

  • Here is the pastebin, since I couldn't format code properly...

    To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

    1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

    2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here. Make sure you save shortcuts.xml while Notepad++ is closed.

    3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

    I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.


    UPDATE

    Navigation with anchors to classes:

    For this, we'll use what is called "Function List".List" (thanks to @Jason Glazer for pointing out it existed)

    1. Use the shortcut [Windows] + R to bring up the run prompt, and type in : %appdata%/notepad++ Windows Explorer will open to the folder in which you'll find functionlist.xml. This is the file you need to modify, and notepad++ must be closed when you save it. So either modify with another text editor, or modify in another location then copy paste. I suggest the latter. And make a copy of your original functionlist.xml just in case, never too safe.

    2. In the <associationmap> section, add an association (see link to pastebin below) In the first, with "userDefinedLangName" replace "EnergyPlus-JM with whatever name you used for your user defined language. (Or delete it) The section, with "ext" associates any file with the extension .idf.

    3. In the "parsers" section, add a new parser with the id "energyplus_class" (see pastebin)

    4. After replacing/saving (with notepad++ closed), reopen notepad++. To see the "navigation pane", you need to activate the Function List pane by clicking on "View" in the navigation menu (top of windows) then "Function List".

    Here is the pastebin, since I couldn't format code properly...

    To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

    1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

    2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here. Make sure you save shortcuts.xml while Notepad++ is closed.

    3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

    I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.


    UPDATE

    Navigation with anchors to classes:

    For this, we'll use what is called "Function List" (thanks to @Jason Glazer @JasonGlazer for pointing out it existed)

    1. Use the shortcut [Windows] + R to bring up the run prompt, and type in : %appdata%/notepad++ Windows Explorer will open to the folder in which you'll find functionlist.xml. This is the file you need to modify, and notepad++ must be closed when you save it. So either modify with another text editor, or modify in another location then copy paste. I suggest the latter. And make a copy of your original functionlist.xml just in case, never too safe.

    2. In the <associationmap> section, add an association (see link to pastebin below) In the first, with "userDefinedLangName" replace "EnergyPlus-JM with whatever name you used for your user defined language. (Or delete it) The section, with "ext" associates any file with the extension .idf.

    3. In the "parsers" section, add a new parser with the id "energyplus_class" (see pastebin)

    4. After replacing/saving (with notepad++ closed), reopen notepad++. To see the "navigation pane", you need to activate the Function List pane by clicking on "View" in the navigation menu (top of windows) then "Function List".

    Here is the pastebin, since I couldn't format code properly...

    To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

    1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

    2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here. Make sure you save shortcuts.xml while Notepad++ is closed.

    3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

    I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.


    UPDATE

    Navigation with anchors to classes:

    For this, we'll use what is called "Function List" (thanks to @JasonGlazer for pointing out it existed)

    1. Use the shortcut [Windows] + R to bring up the run prompt, and type in : %appdata%/notepad++ Windows Explorer will open to the folder in which you'll find functionlist.xml. This is the file you need to modify, and notepad++ must be closed when you save it. So either modify with another text editor, or modify in another location then copy paste. I suggest the latter. And make a copy of your original functionlist.xml just in case, never too safe.

    2. In the <associationmap> section, add an association (see link to pastebin below) below). In the first, with "userDefinedLangName" first association, with "userDefinedLangName", replace "EnergyPlus-JM "EnergyPlus-JM" with whatever name you used for your user defined language. (Or delete it) The section, second association with "ext" associates any file with the extension .idf.

    3. In the "parsers" section, add a new parser with the id "energyplus_class" (see pastebin)

    4. After replacing/saving (with notepad++ closed), reopen notepad++. To see the "navigation pane", you need to activate the Function List pane by clicking on "View" in the navigation menu (top of windows) then "Function List".

    Here is the pastebin, since I couldn't format code properly...

    To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

    1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

    2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here. Make sure you save shortcuts.xml while Notepad++ is closed.

    3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

    I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.


    UPDATE

    Navigation with anchors to classes:

    For this, we'll use what is called "Function List" (thanks to @JasonGlazer for pointing out it existed)

    1. Use the shortcut [Windows] + R to bring up the run prompt, and type in : %appdata%/notepad++ Windows Explorer will open to the folder in which you'll find functionlist.xml. This is the file you need to modify, and notepad++ must be closed when you save it. So either modify with another text editor, or modify in another location then copy paste. I suggest the latter. And make a copy of your original functionlist.xml just in case, never too safe.

    2. In the <associationmap> section, add an association (see link to pastebin below). In the first association, with "userDefinedLangName", replace "EnergyPlus-JM" with whatever name you used for your user defined language. (Or delete it) The second association with "ext" associates any file with the extension .idf.

    3. In the "parsers" section, add a new parser with the id "energyplus_class" (see pastebin)

    4. After replacing/saving (with notepad++ closed), reopen notepad++. To see the "navigation pane", you need to activate the Function List pane by clicking on "View" in the navigation menu (top of windows) then "Function List". List", and you should see something like the following. Notice the pane on the right. Function List Pane on the right

    Here is the pastebin, since I couldn't format code properly...

    To achieve code folding, I've found a workaround that consists in using the User Language and a macro to include opening and closing statements. It will allow folding entire classes or just objects (retaining only the object type and its Name, not the other attributes: see second image below)

    1. In the User Defined language, I've set in "Folding in comment style". Open: "#[" "#{". Close: "]#" "}#" Brackets are for objects and curly braces for classes. User Defined Language: Setting the opening and closing statements

    2. I created a macro to include those opening and closing statements in the IDF file. It's using the comments that are auto-generated when saving via the IDF editor, and I'm assuming it's in "sortedorder" considering I'm also folding the classes. The macro is basically performing a few Find and replace based on regular expression. You will need to modify the "shortcuts.xml" file located in "%appdata%\Notepad++/" and add the macro. I don't see an option to post and format code here, so I created a pastebin located here. Make sure you save shortcuts.xml while Notepad++ is closed.

    3. Then you can reopen notepad++, and under "Macro" run the "Add brackets to Eplus classes" one. Then try folding level 2 with ALT+2, then the rest with ALT+1. Code folded on two levels: classes and objects

    I'll welcome any feedback/bug report, especially considering I only tested it on a couple of files, so there are some exception I might not be handling properly.


    UPDATE

    Navigation with anchors to classes:

    For this, we'll use what is called "Function List" (thanks to @JasonGlazer for pointing out it existed)

    1. Use the shortcut [Windows] + R to bring up the run prompt, and type in : %appdata%/notepad++ Windows Explorer will open to the folder in which you'll find functionlist.xml. This is the file you need to modify, and notepad++ must be closed when you save it. So either modify with another text editor, or modify in another location then copy paste. I suggest the latter. And make a copy of your original functionlist.xml just in case, never too safe.

    2. In the <associationmap> section, add an association (see link to pastebin below). In the first association, with "userDefinedLangName", replace "EnergyPlus-JM" with whatever name you used for your user defined language. (Or delete it) The second association with "ext" associates any file with the extension .idf.

    3. In the "parsers" section, add a new parser with the id "energyplus_class" (see pastebin)

    4. After replacing/saving (with notepad++ closed), reopen notepad++. To see the "navigation pane", you need to activate the Function List pane by clicking on "View" in the navigation menu (top of windows) then "Function List", and you should see something like the following. Notice the pane on the right. Function List Pane on the right

    Here is the pastebin, since I couldn't format code properly...


    Update: Github repo

    Go to my Github repository for the latest files and installation instructions.