& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
Save or reuse your Informed Design code block rules, with export or import to an IDC file.
Type:
Tutorial
Length:
6 min.
Transcript
00:00
When working with code blocks, we can import and export blocks from a product definition.
00:09
The information being imported or exported is stored in a file with an IDC extension.
00:16
The exported file can be used for backup, allowing us to revert to a previous version,
00:22
or allowing us to restore accidentally deleted blocks.
00:27
The IDC file can also be imported into another product definition within a different Inventor project,
00:34
allowing for quick and easy reuse of previously defined logic.
00:39
Here, we have code blocks for key parameters in our current product definition that we would like to reuse in another project.
00:48
Right-clicking in the canvas presents an option to export blocks.
00:53
More specifically, Export 10 blocks.
00:57
In this example, each of the five lines of blocks is comprised of two blocks.
01:03
To the left of the equal sign is the parameter block, and on the right, a block defining the value.
01:11
When choosing the export blocks option, a Save As dialog box
01:16
will allow you to choose the desired location for your saved code block IDC file.
01:23
Here, we'll give this file a meaningful name and save it to a Codeblock Library location so that we can reuse it later.
01:31
Upon clicking the Save button, an informational message displays to let us know the file exported successfully.
01:39
Switching to another project file, which contains a product definition
01:44
we are just beginning to define, our goal is to import the code blocks we previously exported.
01:51
Editing the product definition and going to the Rules tab,
01:55
we'll find the canvas is empty and ready for us to add code blocks.
02:00
Right-clicking in the canvas, we'll find the Import Blocks option.
02:05
Selecting Import Blocks will open the Import dialog window,
02:09
allowing us to navigate to a previously saved code block IDC file.
02:15
Clicking the Open button imports the blocks and returns us back to the canvas
02:21
where we are greeted with an informational message to let us know the import was successful.
02:26
Once imported, an additional comment code block is added to indicate that the blocks below the comment were the ones we imported.
02:35
When importing code blocks containing parameters that aren't present,
02:40
variables that already exist, or duplicate functions,
02:44
we want to be aware of how these are handled.
02:48
Here, we have a rule containing a function, and a few named Variables,
02:53
as well as a variable called Test_Var that the rule isn't using.
02:57
To demonstrate what happens when these items are imported, we'll first Export them to an IDC file.
03:04
Next, within a different product definition, we'll look at the parameters and note that only one has been adopted.
03:13
Going to the Rules tab, we'll take a look at the Variables blocks and note that no named variables exist yet.
03:21
Since our plan is to Import Blocks from an IDC file,
03:25
we'll remove the existing block and then right-click and choose Import Blocks.
03:30
Upon doing so, we are greeted by a message informing us that the rule now contains one or more inputs that have not yet been adopted.
03:40
We'll also see the Nominal Wall Height block indicates that it is the imported input in question.
03:47
A quick look at the Variables blocks, and we find that the variables referenced in the exported blocks
03:53
have been imported and are now listed, as well as that unused variable called Test_Var.
03:60
A look at the Functions blocks, and we see the function called Conversion_To_Inch has been imported and is listed also.
04:08
To resolve the issue with the unadopted parameter,
04:12
we'll return to the Parameters tab and select the parameter from the list.
04:17
Returning to the Rules tab, we see the Nominal Wall Height blocks no longer indicate the unadopted status.
04:24
Let's see what happens when we Import Blocks containing named variables and functions that are already present in the rule.
04:33
What we find is that importing an IDC file with references to variable or function names
04:40
already in use causes the names to auto increment as shown.
04:44
Here, each item found to be present, or in use, is imported with the same name plus the number one.
04:53
But what about our conversion function?
04:58
Yep. It's incremented as well.
05:04
In summary, code block information can be imported and exported between product definitions,
05:13
enabling the reuse across multiple projects.
05:16
The code block information is saved as an IDC file
05:20
and should be given a meaningful name and saved in a meaningful location for future access.
05:26
Once the code block information has been imported,
05:29
an additional comment code block is added to assist an additional organization
05:35
and tracking in extensive rule definition situations.
Video transcript
00:00
When working with code blocks, we can import and export blocks from a product definition.
00:09
The information being imported or exported is stored in a file with an IDC extension.
00:16
The exported file can be used for backup, allowing us to revert to a previous version,
00:22
or allowing us to restore accidentally deleted blocks.
00:27
The IDC file can also be imported into another product definition within a different Inventor project,
00:34
allowing for quick and easy reuse of previously defined logic.
00:39
Here, we have code blocks for key parameters in our current product definition that we would like to reuse in another project.
00:48
Right-clicking in the canvas presents an option to export blocks.
00:53
More specifically, Export 10 blocks.
00:57
In this example, each of the five lines of blocks is comprised of two blocks.
01:03
To the left of the equal sign is the parameter block, and on the right, a block defining the value.
01:11
When choosing the export blocks option, a Save As dialog box
01:16
will allow you to choose the desired location for your saved code block IDC file.
01:23
Here, we'll give this file a meaningful name and save it to a Codeblock Library location so that we can reuse it later.
01:31
Upon clicking the Save button, an informational message displays to let us know the file exported successfully.
01:39
Switching to another project file, which contains a product definition
01:44
we are just beginning to define, our goal is to import the code blocks we previously exported.
01:51
Editing the product definition and going to the Rules tab,
01:55
we'll find the canvas is empty and ready for us to add code blocks.
02:00
Right-clicking in the canvas, we'll find the Import Blocks option.
02:05
Selecting Import Blocks will open the Import dialog window,
02:09
allowing us to navigate to a previously saved code block IDC file.
02:15
Clicking the Open button imports the blocks and returns us back to the canvas
02:21
where we are greeted with an informational message to let us know the import was successful.
02:26
Once imported, an additional comment code block is added to indicate that the blocks below the comment were the ones we imported.
02:35
When importing code blocks containing parameters that aren't present,
02:40
variables that already exist, or duplicate functions,
02:44
we want to be aware of how these are handled.
02:48
Here, we have a rule containing a function, and a few named Variables,
02:53
as well as a variable called Test_Var that the rule isn't using.
02:57
To demonstrate what happens when these items are imported, we'll first Export them to an IDC file.
03:04
Next, within a different product definition, we'll look at the parameters and note that only one has been adopted.
03:13
Going to the Rules tab, we'll take a look at the Variables blocks and note that no named variables exist yet.
03:21
Since our plan is to Import Blocks from an IDC file,
03:25
we'll remove the existing block and then right-click and choose Import Blocks.
03:30
Upon doing so, we are greeted by a message informing us that the rule now contains one or more inputs that have not yet been adopted.
03:40
We'll also see the Nominal Wall Height block indicates that it is the imported input in question.
03:47
A quick look at the Variables blocks, and we find that the variables referenced in the exported blocks
03:53
have been imported and are now listed, as well as that unused variable called Test_Var.
03:60
A look at the Functions blocks, and we see the function called Conversion_To_Inch has been imported and is listed also.
04:08
To resolve the issue with the unadopted parameter,
04:12
we'll return to the Parameters tab and select the parameter from the list.
04:17
Returning to the Rules tab, we see the Nominal Wall Height blocks no longer indicate the unadopted status.
04:24
Let's see what happens when we Import Blocks containing named variables and functions that are already present in the rule.
04:33
What we find is that importing an IDC file with references to variable or function names
04:40
already in use causes the names to auto increment as shown.
04:44
Here, each item found to be present, or in use, is imported with the same name plus the number one.
04:53
But what about our conversion function?
04:58
Yep. It's incremented as well.
05:04
In summary, code block information can be imported and exported between product definitions,
05:13
enabling the reuse across multiple projects.
05:16
The code block information is saved as an IDC file
05:20
and should be given a meaningful name and saved in a meaningful location for future access.
05:26
Once the code block information has been imported,
05:29
an additional comment code block is added to assist an additional organization
05:35
and tracking in extensive rule definition situations.
Codeblocks can be imported and exported from a Product definition. Exported information is stored in a file with an IDC extension. The exported file can be used for backup, to revert to a previous version, or to restore accidentally deleted blocks. The IDC file can be imported into another product definition within a different Inventor project, allowing for reuse of already-defined logic.
In this example, code blocks for key parameters are already defined. There are five lines of blocks comprised of two blocks each, resulting in 10 blocks.
To reuse these blocks in another project:
A message confirms that the file was exported successfully.
A message confirms that the import was successful, and a comment code block is added to help identify the imported blocks.
Sometimes imported blocks contain parameters that do not exist in the product definition, variables that already exist, or duplicate functions. To demonstrate how this is handled, a rule with a function, several named variables, and an unused variable called Test_Var are being exported to an IDC file.
In the product definition where the IDC file will be imported, first, verify the existing parameters and variables:
Now, import the file:
A message indicates that the rule contains one or more inputs that have not been adopted.
In the canvas, a message icon displays on the Nominal Wall Height block, indicating that it is the unadopted input.
Check that the variables and functions imported properly:
To resolve the issue with the unadopted parameter:
Next, blocks containing named variables and functions already in use are imported.
The variables and functions found to be present or in use are automatically given the same name plus a number, such as Height1 and Length1.
In summary, code block information can be exported and then imported between product definitions, enabling reuse across multiple projects. The code block information is saved as an IDC file. Once the code block information has been imported, an additional comment code block is added to assist in organization and tracking of imported rules.
How to buy
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved
Sign in for the best experience
Save your progress
Get access to courses
Receive personalized recommendations
May we collect and use your data?
Learn more about the Third Party Services we use and our Privacy Statement.May we collect and use your data to tailor your experience?
Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.