ETO サーバ サンプル プロジェクト

このサンプルはブロックのグリッドを作成します。これは ここからダウンロードします。

サンプル フォルダには、Inventor の完全な Intent プロジェクト、タスクの説明ファイル(TaskDescription.xml)、サンプルを実行するための手順が記載された readme ファイルが含まれています。サンプルの Intent プロジェクトは、ブロックのグリッドを作成します。行と列の数は、それぞれ行と列のパラメータによってコントロールされます。Grid? と呼ばれる 3 つめのブール値パラメータがあり、これはブロックをグリッド パターンに配置するか、または原点で互いの上に配置するかをコントロールします。

サンプルを実行するには、コマンド ウィンドウを開きます。次のコマンドを入力して、InventorETOServer.exe の場所のフォルダを変更します。

CD "c:\Program Files\Autodesk\Inventor ETO Server <version>\Bin"

次のコマンドを入力し、Intent サーバを実行して適切なタスクの説明ファイルを起動します。

InventorETOServer.exe -b "C:\Users\Public\Documents\Autodesk\Intent 2012\Intent Server\Grid\TaskDescription.xml"

このコマンドは、出力情報を追加する TaskDescription.xml ファイルのコピーが含まれる出力フォルダを作成します。下記は、実行前の TaskDescription.xml ファイルの内容です。

<?xml version="1.0" encoding="utf-8" ?>
<IntentServer name="Intent Server Sample" outputDir="Output" trace="true">
  <!--Load sample project -->
  <Project name="IntentServerSample" timing="true">
    <!--Create new model -->
    <NewModel name="Simple Model" baseDesign="SuperAssembly">
     
      <!-- Place blocks in grid, go with the default counts-->
      <SetRuleValue part="Root" rule="Grid?" expression="true"/>
      <Evaluate expression="RenderSelf" timing="true"/>
      <!-- what is a bounding box? -->
      <Evaluate expression="IvExtGetBoundingBox(Root)"/>

      <!-- Change grid size to 10X10 -->
      <SetRuleValue rule="Rows" expression="10"/>
      <SetRuleValue rule="Columns" expression="10"/>
      <Evaluate expression="RenderSelf"/>
      <!-- what is a bounding box now? -->
      <Evaluate expression="IvExtGetBoundingBox(Root)"/> 

      <!-- Move ALL blocks into origin-->
      <SetRuleValue part="Root" rule="Grid?" expression="false"/>
      <Evaluate expression="RenderSelf"/>
      <!-- what is a bounding box now? -->
      <Evaluate expression="IvExtGetBoundingBox(Root)"/>

    </NewModel> 

  </Project>
  <!-- more projects-->
</IntentServer>

サンプルの実行後は、出力フォルダ内の TaskDescription.xml ファイルは次のようになります。

<?xml version="1.0" encoding="utf-8"?>
<IntentServer name="Intent Server Sample" outputDir="Output" trace="true" machine="WAL12376058" user="korzuna" intent="4.0.103.0" inventor="2012 (Build 150237000, 237)">
  <!--Load sample project -->
  <Project name="IntentServerSample" timing="true" start="3/25/2010 1:14:01 PM" end="3/25/2010 1:14:11 PM">
    <!--Create new model -->
    <NewModel name="Simple Model" baseDesign="SuperAssembly">
      <!-- Place blocks in grid, go with the default counts-->
      <SetRuleValue part="Root" rule="Grid?" expression="true" result="Success" />
      <Evaluate expression="RenderSelf" timing="true" start="3/25/2010 1:14:03 PM" end="3/25/2010 1:14:05 PM" result="{}" />
      <!-- what is a bounding box? -->
      <Evaluate expression="IvExtGetBoundingBox(Root)" result="{p&lt;10.0, 6.0, -3.5&gt;, p&lt;45.0, 49.0, 3.5&gt;}" />
      <!-- Change grid size to 10X10 -->
      <SetRuleValue rule="Rows" expression="10" result="Success" />
      <SetRuleValue rule="Columns" expression="10" result="Success" />
      <Evaluate expression="RenderSelf" result="{}" />
      <!-- what is a bounding box now? -->
      <Evaluate expression="IvExtGetBoundingBox(Root)" result="{p&lt;10.0, 6.0, -3.5&gt;, p&lt;111.0, 115.0, 3.5&gt;}" />
      <!-- Move ALL blocks into origin-->
      <SetRuleValue part="Root" rule="Grid?" expression="false" result="Success" />
      <Evaluate expression="RenderSelf" result="{}" />
      <!-- what is a bounding box now? -->
      <Evaluate expression="IvExtGetBoundingBox(Root)" result="{p&lt;-1.0, -5.0, -3.5&gt;, p&lt;1.0, 5.0, 3.5&gt;}" />
    </NewModel>
  </Project>
  <!-- more projects-->
</IntentServer>