& 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
When working with code blocks, we can import and export blocks from a product definition. The information being imported or exported is stored in a file with an IDC extension. The exported file can be used for backup, allowing us to revert to a previous version or allow us to restore accidentally deleted blocks.
Type:
Tutorial
Length:
6 min.
Transcript
00:03
When working with code blocks,
00:05
we can import and export blocks from a product definition.
00:09
The information being imported or exported is stored
00:13
in a file with an IDC extension.
00:16
The exported file can be used for backup,
00:19
allowing us to revert to a previous version
00:23
or allow us to restore accidentally deleted blocks.
00:27
The IDC file can also be imported into
00:30
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
00:44
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:58
In this example, each of the five lines of blocks is comprised of two blocks
01:04
to the left of the equal sign is the parameter block
01:07
and on the right, a block defining the value.
01:11
When choosing the export blocks option,
01:14
a save as dialog box will allow you to choose the desired location
01:19
for your saved code block IDC file.
01:23
Here we'll give this file a meaningful name
01:26
and save it to a code block library location
01:29
so that we can reuse it later
01:32
upon clicking the save button and informational message
01:35
displays to let us know the file exported successfully
01:40
switching to another project file which contains a product definition.
01:44
We are just beginning to define.
01:47
Our goal is to import the code blocks we previously exported,
01:52
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 dialogue window
02:09
allowing us to navigate to a previously saved code block IDC file,
02:16
clicking the open button,
02:17
imports the blocks and returns us back to the canvas where we are
02:21
greeted with an informational message to let us know the import was successful.
02:27
Once imported an additional comment,
02:29
code block is added to indicate that the
02:32
blocks below the comment were the ones we imported
02:36
when importing code blocks containing parameters that aren't present
02:40
variables that already exist
02:43
or duplicate functions.
02:44
We want to be aware of how these are handled
02:48
here.
02:48
We have a rule containing a function and a few
02:51
named variables as well as a variable called test.
02:55
Far that the rule isn't using
02:57
to demonstrate what happens when these items are imported.
03:01
We'll first export them to an IDC file
03:05
next, within a different product definition.
03:08
We'll look at the parameters and note that only one has been adopted.
03:13
Going to the rules tab.
03:15
We'll take a look at the variables blocks
03:17
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.
03:32
We are greeted by a message informing us that the rule now
03:36
contains one or more inputs that have not yet been adopted.
03:40
We'll also see the nominal wall height block indicates
03:44
that it is the imported input in question,
03:47
a quick look at the variables blocks
03:49
and we find that the variables referenced in the
03:52
exported blocks have been imported and are now listed
03:56
as well as that unused variable called test.
03:59
Far
04:00
a look at the functions blocks
04:02
and we see the function called conversion to
04:05
inch has been imported and is listed also
04:08
to resolve the issue with the un adopted parameter.
04:12
We'll return to the parameters tab and select the parameter from the list,
04:17
returning to the rules tab.
04:19
We see the nominal wall height blocks no longer indicate the un adopted status.
04:25
Let's see what happens when we import blocks containing named
04:29
variables and functions that are already present in the rule.
04:34
What we find is that importing an IDC file
04:37
with references to variable or function names already in use
04:41
causes the names to auto increment as shown
04:45
here.
04:46
Each item found to be present or in use is
04:49
imported with the same name plus the number one.
04:54
But what about our conversion function.
04:58
Yep, it's incremented as well.
05:06
In summary code block information can be
05:09
imported and exported between product definitions,
05:13
enabling the reuse across multiple projects.
05:16
The code block information is saved as an
05:19
IDC file and should be given a meaningful name
05:22
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 in additional organization
05:35
and tracking in extensive rule definition situations.
Video transcript
00:03
When working with code blocks,
00:05
we can import and export blocks from a product definition.
00:09
The information being imported or exported is stored
00:13
in a file with an IDC extension.
00:16
The exported file can be used for backup,
00:19
allowing us to revert to a previous version
00:23
or allow us to restore accidentally deleted blocks.
00:27
The IDC file can also be imported into
00:30
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
00:44
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:58
In this example, each of the five lines of blocks is comprised of two blocks
01:04
to the left of the equal sign is the parameter block
01:07
and on the right, a block defining the value.
01:11
When choosing the export blocks option,
01:14
a save as dialog box will allow you to choose the desired location
01:19
for your saved code block IDC file.
01:23
Here we'll give this file a meaningful name
01:26
and save it to a code block library location
01:29
so that we can reuse it later
01:32
upon clicking the save button and informational message
01:35
displays to let us know the file exported successfully
01:40
switching to another project file which contains a product definition.
01:44
We are just beginning to define.
01:47
Our goal is to import the code blocks we previously exported,
01:52
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 dialogue window
02:09
allowing us to navigate to a previously saved code block IDC file,
02:16
clicking the open button,
02:17
imports the blocks and returns us back to the canvas where we are
02:21
greeted with an informational message to let us know the import was successful.
02:27
Once imported an additional comment,
02:29
code block is added to indicate that the
02:32
blocks below the comment were the ones we imported
02:36
when importing code blocks containing parameters that aren't present
02:40
variables that already exist
02:43
or duplicate functions.
02:44
We want to be aware of how these are handled
02:48
here.
02:48
We have a rule containing a function and a few
02:51
named variables as well as a variable called test.
02:55
Far that the rule isn't using
02:57
to demonstrate what happens when these items are imported.
03:01
We'll first export them to an IDC file
03:05
next, within a different product definition.
03:08
We'll look at the parameters and note that only one has been adopted.
03:13
Going to the rules tab.
03:15
We'll take a look at the variables blocks
03:17
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.
03:32
We are greeted by a message informing us that the rule now
03:36
contains one or more inputs that have not yet been adopted.
03:40
We'll also see the nominal wall height block indicates
03:44
that it is the imported input in question,
03:47
a quick look at the variables blocks
03:49
and we find that the variables referenced in the
03:52
exported blocks have been imported and are now listed
03:56
as well as that unused variable called test.
03:59
Far
04:00
a look at the functions blocks
04:02
and we see the function called conversion to
04:05
inch has been imported and is listed also
04:08
to resolve the issue with the un adopted parameter.
04:12
We'll return to the parameters tab and select the parameter from the list,
04:17
returning to the rules tab.
04:19
We see the nominal wall height blocks no longer indicate the un adopted status.
04:25
Let's see what happens when we import blocks containing named
04:29
variables and functions that are already present in the rule.
04:34
What we find is that importing an IDC file
04:37
with references to variable or function names already in use
04:41
causes the names to auto increment as shown
04:45
here.
04:46
Each item found to be present or in use is
04:49
imported with the same name plus the number one.
04:54
But what about our conversion function.
04:58
Yep, it's incremented as well.
05:06
In summary code block information can be
05:09
imported and exported between product definitions,
05:13
enabling the reuse across multiple projects.
05:16
The code block information is saved as an
05:19
IDC file and should be given a meaningful name
05:22
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 in additional organization
05:35
and tracking in extensive rule definition situations.
The IDC file can also be imported into another product definition within a different inventor project, allowing for quick and easy reuse of previously defined logic.
Here we have code blocks for key parameters in our current product definition that we would like to reuse in another project.
Right clicking in the canvas presents an option to export blocks.
More specifically, export ten blocks.
In this example, each of the five lines of blocks is comprised of two blocks.
To the left of the equal sign is the parameter block, and on the right, a block defining the value.
When choosing the export blocks option, a save as dialogue box will allow you to choose the desired location for your saved code block IDC file.
Here, we'll give this file a meaningful name and save it to a code block library location so that we can reuse it later.
Upon clicking the save button, an informational message displays to let us know the file exported successfully.
Switching to another project file which contains a product definition we are just beginning to define, our goal is to import the code blocks we previously exported.
Editing the product definition and going to the rules tab, we'll find the canvas is empty and ready for us to add code blocks.
Right clicking in the canvas, we'll find the import blocks option.
Selecting import blocks will open the import dialogue window, allowing us to navigate to a previously saved code block IDC file.
Clicking the open button imports the blocks and returns us back to the canvas where we are greeted with an informational message to let us know the import was successful.
Once imported, an additional comment code block is added to indicate that the blocks below the comment were the ones we imported.
When importing code blocks containing parameters that aren't present, variables that already exist, or duplicate functions, we want to be aware of how these are handled.
Here we have a rule containing a function and a few named variables as well as a variable called test var that the rule isn't using.
To demonstrate what happens when these items are imported, we'll first export them to an IDC file.
Next, within a different product definition, we'll look at the parameters and note that only one has been adopted.
Going to the rules tab, we'll take a look at the variables blocks and note that no named variables exist yet.
Since our plan is to import blocks from an IDC file, we'll remove the existing block and then right click and choose import blocks.
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.
We'll also see the nominal wall height block indicates that it is the imported input in question.
A quick look at the variables blocks, and we find that the variables referenced in the exported blocks have been imported and are now listed, as well as that unused variable called test var.
A look at the functions blocks, and we see the function called conversion to inch has been imported and is listed also.
To resolve the issue with the unadopted parameter, we'll return to the parameters tab and select the parameter from the list.
Returning to the rules tab, we see the nominal wall height blocks no longer indicate the unadopted status.
Let's see what happens when we import blocks containing named variables and functions that are already present in the rule.
What we find is that importing an IDC file with references to variable or function names already in use causes the names to auto increment as shown.
Here, each item found to be present or in use is imported with the same name plus the number one.
But what about our conversion function?
Yep. It's incremented as well.
In summary, code block information can be imported and exported between product definitions, enabling the reuse across multiple projects.
The code block information is saved as an IDC file and should be given a meaningful name and saved in a meaningful location for future access. Once the code block information has been imported, an additional comment code block is added to assist an additional organization and tracking in extensive rule definition situations.
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.