Autodesk.Intent.Services DLL

The first component to be aware of is the DLL that contains the web services API contract, and client proxy class. Use of this DLL in your client application is optional. It provides some helpful utilities for creating your own proxies and services. Alternatively, you can use the Intent Services by adding a Service Reference to your .NET application, which can generate a client proxy for you.

IntentServicesClient

This is a pre-built client proxy class that can be used by .NET clients to access the web services. It has multiple constructors that work the same way as the constructors provided by client proxy generated by a service reference plus one additional constructor taking an Uri argument.

The default constructor requires that the client is configured in the application configuration file (or web.config if the client is a web site). Here is an example of what the configuration looks like for a named pipe endpoint:
<configuration>
  <system.serviceModel>
    <bindings>
      <netNamedPipeBinding>
        <binding name="NetNamedPipeBinding_IIntentServices" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
          transactionFlow="false" transferMode="Buffered"
          hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="67108864"
          maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="67108864">
          <readerQuotas maxDepth="32"
                        maxStringContentLength="33554432"
                        maxArrayLength="67108864"
                        maxBytesPerRead="4096"
                        maxNameTableCharCount="16384" />
          <security mode="Transport">
            <transport protectionLevel="EncryptAndSign" />
          </security>
        </binding>
      </netNamedPipeBinding>
    </bindings>
    <client>
      <endpoint address="net.pipe://localhost/Autodesk/Intent/Services"
                binding="netNamedPipeBinding"
                bindingConfiguration="NetNamedPipeBinding_IIntentServices"
                contract="Autodesk.Intent.Services.IIntentServices"
                name="NetNamedPipeBinding_IIntentServices">
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>

The extra constructor takes an URI pointing to the WCF endpoint hosting IIntentServices. It should be instantiated with the URI of the Intent Session Manager Service (see below) in order for the client application to access the remote API.

IIntentServices:

This interface defines which operations are available on the web services. The API is similar to the standard Intent API with a few exceptions.

Remote API Summary

Note: A WCF API is not an object-oriented API. For example, objects or collections of objects that contain their own operations cannot be returned. Instead, all operations exist on a single interface (IIntentServices). Instead, operations that, in an OO API act on a contained object, are implemented with a parameter to specify the ID of the object. For example, operations that act on a part take a partRefChain argument. Below is a high-level summary. The entire API is available in the IntentAPI.chm file in the install directory\Help folder.
Administration
  • SetApplication - Initializes the Intent Session by loading the specified Intent Application that was previously configured on the Inventor ETO Server Configurator.
  • GetApplication - Returns the name of the application specified in SetApplication .
  • IntentVersion - Returns a string representing the Intent Version number.
Model Load/Save
  • ImportModel - Loads a model from a string containing the model code. (This will fail if the model is not empty.)
  • ExportModel - Exports the current model to a string .
  • Reset - Resets the model. This must be called before ImportModel if the model is not empty.
Part-Specific Operations
Rules

The API has a Get and Set for each of the supported types. There is one weakly-typed version for each (that is, GetValue , SetValue ), which boxes the value as a .Net Object.

There is also a strong-typed version for each of the internal Intent Types.

  • Boolean
  • Integer
  • Number
  • String
  • Point
  • Vector
  • Name
  • List (as object[])

The weakly-typed version supports all of the internal Intent Types plus objects to support arbitrary binary streams (for example, byte[], Stream, MemoryStream).

Additionally, there is an operation to enable setting a rule by formula.

  • SetRuleFormula – Takes a string representing the formula used to set the rule.
Others
  • AddDynamicChildRule - Adds a new dynamic child rule to the part .
  • DeleteDynamicRules - Deletes all dynamic rules on the specified part .
  • Unbind - Unbinds the rule.
  • IsBound - Determines if a rule is bound.
  • Render - Renders the model.

IntentServicesWrapper

This abstract base class acts as a wrapper for another class that implements IIntentServices. You can use it to easily create a SOAP-based web service implementation that you can expose through your web application. Use it to wrap an IntentServicesClient object.