Transcript
Page 1: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

1 / 33

Autodesk Inventor

iLogic チュートリアル Part 3

アセンブリドキュメントのルール作成 これは、3 つの章に分かれたチュートリアルの Part 3 です。Part 1 では、iLogic でルールを作成・実行して、

パーツドキュメントのパラメータ値を外部からコントロールする方法を学習します。Part 2 では、iLogic で

Excel スプレッドシートと関連付けたルールを作成・実行して、Excel スプレッドシートを参照して、パーツドキュ

メントのパラメータ値を外部からコントロールする方法を学習します。Part 3 では、iLogic でルールを作成・実

行して、アセンブリおよびコンポーネントのパラメータ値を外部からコントロールする方法を学習します。

iLogic チュートリアルでの学習は、Part 1 から順番に進めるようにしてください。

チュートリアル Part 3 のカリキュラムは、次のとおりです。

アセンブリの作成:コンポーネントを配置し、アセンブリ拘束を適用して、アセンブリを組み立てます。

オカレンス名の変更:ルールの作成で参照しやすいように、わかりやすい名前に変更します。

拘束パラメータ名の変更:ルールの作成で参照しやすいように、わかりやすい名前に変更します。

パターンコンポーネント名の変更:ルールの作成で参照しやすいように、わかりやすい名前に変更します。

パラメータの作成:パラメータエディタを使用して、ルールの作成に使用するパラメータやパラメータ値のリ

ストを作成します。

ルールの作成:ルールエディタを使用して、ルールを作成します。

Excel スプレッドシートとの関連付け:コンポーネントの Excel スプレッドシートを参照するルールを作成し

ます。

iPart テーブルとの関連付け:コンポーネントの iPart テーブルを参照するルールを作成します。

Excel スプレッドシートの更新:Excel スプレッドシートを更新させるルールを作成します。

ルールのテスト:ルールを実行して、コンポーネントの構成や形状の変化を確認します。

Page 2: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

2 / 33

チュートリアル Part 3 の概要

チュートリアル Part 3 では、アセンブリドキュメントを新規作成し、チュートリアル Part 2 で作成したマニホー

ルドブロックなどのコンポーネントを配置して組み立てた後に、iLogic でパーツコンポーネントの配置構成や、

マニホールドブロックの各形状に関するルールを作成・実行して、iLogic のルールに基づいて、アセンブリドキ

ュメントおよびパーツコンポーネントのパラメータ値を外部からコントロールする方法を学習していきます。

アセンブリを作成する

これから、アセンブリドキュメントを新規作成し、パーツコンポーネントを配置して組み立てていきます。

アセンブリドキュメントの新規作成

チュートリアル Part 3 で使用するアセンブリドキュメントを新規作成します。

1. Autodesk Inventor を起動し、アプリケーション メニューから[管理][プロジェクト]を選択して、[プロジェク

ト]ダイアログを表示します。または[スタートアップ]タブから[プロジェクト]を選択して、[プロジェクト]ダイア

ログを表示します。

2. プロジェクトリストで Inventor プロジェクト[iLogic 2009 Tutorial]をアクティブにして、 [完了]ボタンをクリッ

クします。

3. アプリケーション メニューから[新規]または[スタートアップ]タブから [新規作成]を選択して[新規ファイル]

ダイアログを表示し、[English]タブのアセンブリテンプレートファイル「Standard (in).iam」をダブルクリック

して開きます。

Page 3: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

3 / 33

4. アプリケーション メニューから[名前を付けて保存]を選択して[名前を付けて保存]ダイアログを表示し、フ

ァイル名「my_manifold_block.iam」を入力して保存します。

これで、チュートリアル Part 3 で使用するアセンブリドキュメントの新規作成が完了しました。

コンポーネントの配置

アセンブリにパーツコンポーネントを配置します。

1. [アセンブリ]タブの[配置]ツールをクリックして、[コンポーネント配置]ダイアログを表示します。

2. チュートリアル Part 2 で作成したパーツドキュメントファイル「manifold_block.ipt」をダブルクリックして、

パーツコンポーネント[manifold_block]を 1 つ配置し、右クリックメニューの「完了」を選択します。

Page 4: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

4 / 33

3. [アセンブリ]タブの[配置]ツールをクリックして、[コンポーネント配置]ダイアログを表示します。

4. パーツドキュメントファイル「union_cap.ipt」をダブルクリックします。これで、[標準 iPart を配置]ダイアロ

グが表示されます。

5. [テーブル]タブをクリックして iPart テーブルを表示し、[Member]列の[Union-01]を選択して、パーツコン

ポーネント[union_cap [Model Code=050]]を 3 つ配置し、右クリックメニューの「完了」を選択します。

6. [アセンブリ]タブの[配置]ツールをクリックして、[コンポーネント配置]ダイアログを表示します。

7. パーツドキュメントファイル「Screw.ipt」をダブルクリックします。これで、[標準 iPart を配置]ダイアログが

表示されます。

8. [テーブル]タブをクリックして iPart テーブルを表示し、[Member]列の[Screw-01]を選択して、パーツコン

ポーネント[Screw-01]を 3 つ配置し、右クリックメニューの「完了」を選択します。

Page 5: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

5 / 33

コンポーネントの表示色の変更

パーツコンポーネント[union_cap [Model Code=050]]の表示色を識別しやすい色に変更します。

1. パーツコンポーネント[union_cap [Model Code=050]]を 1 つクリックして選択セットに含めた後に、標準

ツールバーの色のオーバーライドリストから[Bule]を選択して、表示色を青色に変更します。

2. 先と同じ要領で、パーツコンポーネント[union_cap [Model Code=050]]の残り 2 つの表示色を青色に変

更します。

コンポーネントのオカレンス名の変更

ルールのプログラムを作成する際に、参照するコンポーネントをできるだけわかりやすくするため、パーツコン

ポーネントのオカレンス名を変更します。

1. [モデル]ブラウザのパーツコンポーネント[union_cap [Model Code=050]:1]のオカレンス名をクリックして

ハイライト表示にし、「port_a_union」を入力してオカレンス名を[port_a_union]に変更します。

2. 先と同じ要領で、パーツコンポーネント[union_cap [Model Code=050]:2]、[union_cap [Model

Code=050]:3]のオカレンス名を[port_b_union]、[port_c_union]に変更します。

3. [モデル]ブラウザのパーツコンポーネント[Screw-01:1]のオカレンス名をクリックしてハイライト表示にし、

「port_a_union_screw」を入力して、オカレンス名を[port_a_union_screw]に変更します。

4. 先と同じ要領で、パーツコンポーネント[Screw-01:2]、[Screw-01:3]のオカレンス名を

「port_b_union_screw」、「port_c_union_screw」に変更します。

Page 6: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

6 / 33

コンポーネントのパラメータの確認

パラメータを作成する前に、チュートリアル Part 2 で作成したパーツコンポーネント[manifold_block:1]の

iLogic で作成したパラメータとパラメータ値を確認しておきます。

1. [モデル]ブラウザの[manifold_block:1]をダブルクリックして、パーツコンポーネント[manifold_block:1]を

アクティブにします。

2. [管理]タブの[パラメータ]パネルから[iLogic Parameters]ツールをクリックして、[Parameter Editor]ダイア

ログを表示します。パラメータリストで、パーツコンポーネント[manifold_block:1]のパラメータとパラメータ

値を次の通りにします。

パラメータ パラメータ値

block tee

component_type standard

port_a_size 0.50

3. パーツコンポーネント[manifold_block:1] のサイズを確認した後に[Done]ボタンをクリックして、ダイアロ

グを閉じます。

4. [モデル]ブラウザの[my_manifold_block.iam]をダブルクリックして、アセンブリをアクティブにしてから、ア

センブリドキュメントを保存します。

コンポーネントの拘束

パーツコンポーネントにアセンブリ拘束を適用して組み立てます。

Page 7: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

7 / 33

1. [アセンブリ]タブの[位置]パネルにある[拘束]ツールをクリックして[拘束を指定]ダイアログを表示します。

2. [アセンブリ]タブで、タイプを[メイト]、拘束タイプを[メイト]に設定し、パーツコンポーネント

[manifold_block:1]のポート A の穴の中心軸と、パーツコンポーネント[port_a_union]のポートの穴の中

心軸を拘束軸に指定して、[適用]ボタンをクリックします。これでポート A の穴とユニオンキャップ A の穴

の中心軸に、メイト拘束が適用されます。

3. パーツコンポーネント[manifold_block:1]のポート A のタップ穴の中心軸と、パーツコンポーネント

[port_a_union]のボルト穴の中心軸を拘束軸に指定して、[適用]ボタンをクリックします。これで、ポート A

のタップ穴とユニオンキャップ A のボルト穴の中心軸に、メイト拘束が適用されます。

4. パーツコンポーネント[manifold_block:1]のポート A の取付面と、パーツコンポーネント[port_a_union]の

取付面を拘束面に指定して、[OK]ボタンをクリックします。これで、ポート A とユニオンキャップ A の取付

面にメイト拘束が適用されます。

Page 8: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

8 / 33

5. [モデル]ブラウザに表示された 3 つのメイト拘束の名前をそれぞれ[port_a_cap_center]、

[port_a_cap_hole]、[ port_a_cap_face]に変更します。

6. [アセンブリ]タブの[拘束]ツールをクリックして[拘束を指定]ダイアログを表示します。

7. [アセンブリ]タブで、タイプを[挿入]、拘束タイプを[反対]に設定し、パーツコンポーネント[port_a_union]の

ボルト穴のエッジと、パーツコンポーネント[port_a_union_screw]の座面エッジを指定して、[OK]ボタンを

クリックします。これでユニオンキャップのボルト穴の 1 つに、ボルトとの挿入拘束が適用されます。

8. [モデル]ブラウザに表示された挿入拘束の名前を[port_a_cap_screw]に変更します

9. 先と同じ要領で、ポート B、C にユニオンキャップとボルトを拘束してから、[モデル]ブラウザに表示された

メイト拘束と挿入拘束の名前を変更します。

Page 9: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

9 / 33

パターンコンポーネントの作成

ユニオンキャップのボルト穴に挿入された 1 本のボルトをパターン化して、4 本のボルトのパターンコンポーネ

ントを作成します。

1. [アセンブリ]タブの[パターン]ツールをクリックして、[パターンコンポーネント]ダイアログを表示します。

2. [矩形状]タブをクリックして、内容を表示します。

3. パターン化するコンポーネントに[port_a_union_screw]をクリックして、パターン化するコンポーネントに

選択します。

4. [列フィールド]の[列方向]ボタンをクリックしてから、ブロックのエッジをクリックしてパターンの方向を設定し、

パターン数「2」、パターン距離「1.50」を入力します。

5. [行]フィールドの[行方向]ボタンをクリックしてから、ブロックのエッジをクリックしてパターンの方向を設定し、

パターン数「2」、パターン距離「0.69」を入力して、[OK]ボタンをクリックします。これで、ポート A のユニオ

ンキャップのボルト穴に、4 つのボルトがパターン配置されます。

6. [モデル]ブラウザに表示された[コンポーネントパターン 1]の名前を、[port_a_screw_pattern]に変更しま

7. [管理]パネルの[パラメータ]ツールをクリックして、[パラメータ]ダイアログを表示します。

8. [計算式]列のパラメータ値が[0.69 in]のパラメータ名をクリックしてハイライト表示にし、

「port_a_y_dist_between_screws」を入力します。

9. [計算式]列のパラメータ値が[1.50 in]のパラメータ名をクリックしてハイライト表示にし、

「port_a_x_dist_between_screws」を入力します。

Page 10: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

10 / 33

10. 先と同じ要領で、ポート B、C にボルトのパターンコンポーネントを作成し、[モデル]ブラウザに表示された

コンポーネントパターンの名前と、[パラメータ]ダイアログに表示されるパラメータ名を変更してから[完了]

ボタンをクリックしてダイアログを閉じます。

11. ボルトが次の通り配置されているか確認した後に、アセンブリドキュメントを保存します。

パラメータを作成する

これから、パラメータエディタを使用して、ルールのプログラム作成に使用するパラメータ

[port_a_size]パラメータ

[port_b_size]パラメータ

[port_c_size]パラメータ

[block]パラメータ

[component_type]パラメータ

を作成していきます。

Page 11: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

11 / 33

[port_a_size]パラメータの作成

1. [管理]パネル[iLogic Parameters]ツールをクリックして、[Parameter Editor]ダイアログを表示します。

2. パラメータリストの一番下の行、[Name]列のセルをクリックして、パラメータ名「port_a_size」を入力します。

3. [port_a_size]行の[Type]列のセルをクリックしてドロップダウンリストを表示し、[User]を選択します。

4. [port_a_size]行の[Unit]列のセルをクリックしてドロップダウンリストを表示し、[in]を選択します。

5. [port_a_size]行の適当な空白セルを右クリックしてメニューを表示し、[Make Multi-Value]を選択して、

[Value List Editer]ダイアログを表示します。

6. [Add New Item(s)]フィールドにパラメータ値「0.50」、「0.75」、「1.00」、「1.25」、「1.50」、「2.00」、「2.50」、

「3.00」を入力し、[Add]ボタンをクリックして[Value]リストに追加します。

7. [OK]ボタンをクリックして、[Value List Editer]ダイアログを閉じます。

8. [part_a_size]行の[Key]列にチェックを入れて、キーパラメータに設定します。

[port_b_size]、[port_c_size]パラメータの作成

[port_a_size]パラメータと同じ内容で、[port_b_size]、[port_c_size]パラメータを作成します。

[component_type]パラメータの作成

1. パラメータリストの一番下の行、[Name]列のセルをクリックして、パラメータ名「component_type」を入力

します。

2. [component_type]行の[Type]列のセルをクリックしてドロップダウンリストを表示し、[Strings]を選択しま

Page 12: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

12 / 33

す。

3. [component_type]行の[Unit]列のセルをクリックして空白にします。

4. [component_type]行の適当な空白セルを右クリックしてメニューを表示し、[Make Multi-Value]を選択し

て、[Value List Editer]ダイアログを表示します。

5. [Add New Item(s)]フィールドにパラメータ値「standard」、「custom」を入力し、[Add]ボタンをクリックして

[Value]リストに追加します。

6. [OK]ボタンをクリックして、[Value List Editer]ダイアログを閉じます。

7. [component_type]行の[Key]列にチェックを入れて、キーパラメータに設定します。

[block]パラメータの作成

1. パラメータリストの一番下の行、[Name]列のセルをクリックして、パラメータ名「block」を入力します。

2. [block]行の[Type]列のセルをクリックしてドロップダウンリストを表示し、[String]を選択します。

3. [block]行の[Unit]列のセルをクリックして空白にします。

4. [block]行の適当な空白セルを右クリックしてメニューを表示し、[Make Multi-Value]を選択して、[Value

List Editer]ダイアログを表示します。

5. [Add New Item(s)]フィールドにパラメータ値「tee」、「elbow」を入力し、[Add]ボタンをクリックして[Value]

リストに追加します。

6. [OK]ボタンをクリックして、[Value List Editer]ダイアログを閉じます。

7. [block]行の[Key]列にチェックを入れて、キーパラメータに設定します。

部品番号のパラメータの作成

1. パラメータリストの一番下の行、[Name]列のセルをクリックして、パラメータ名

「port_a_union_part_number」を入力します。

2. [port_a_union_part_number]行の[Type]列のセルをクリックしてドロップダウンリストを表示し、[String]を

選択します。

3. [port_a_union_part_number]行の[Unit]列のセルをクリックして空白にします。

4. [port_a_union_part_number]行の[Key]列にチェックを入れて、キーパラメータに設定します。

5. 先と同じ要領で、[port_b_union_part_number]、[port_c_union_part_number]、

[port_a_screw_part_number]、[port_b_screw_part_number]、[port_c_screw_part_number]パラメー

タを作成します。

Page 13: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

13 / 33

6. [Done]ボタンをクリックしてダイアログを閉じてから、アセンブリドキュメントを保存します。

これで、ルールのプログラム作成に使用するパラメータの作成は、すべて完了しました。

ルールを作成する

これから、ルールエディタを使用して、アセンブリおよびコンポーネントのパラメータ値をコントロールするため

のルール

コンポーネントへのパスのルール

コンポーネントのタイプのルール

ポート A のルール

ポート B のルール

ポート C のルール

ボルトの部品番号のルール

Excel スプレッドシート更新のルール

のプログラムを作成していきます。

コンポーネントへのパスのルール

パラメータの作成段階では、[port_a_size]、[port_b_size]、[port_c_size]パラメータを作成して、パラメータ値

を割り当てました。これから、これらのパラメータとパラメータ値を構文に使用して、コンポーネントへのパスの

ルールのプログラムを作成します。

パラメータエディタの[Multi-Value]リストでパラメータ値を選択すると、チュートリアル Part 2 で作成したパーツ

コンポーネント「manifold_block:1」のルールを実行する、そんな動作のルールを実行できるようにします。

ルールのプログラムの作成

1. [管理]タブの[iLogic]パネルの[Add Rule]ツールをクリックして、[Rule Name]ダイアログを表示します。

Page 14: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

14 / 33

2. [Name]フィールドにルール名「assembly_to_parts_rule」を入力し、[OK]ボタンをクリックして、[Edit

Rule]ダイアログを表示します。

3. テキストフィールドに、次の通りに構文を入力します。パラメータ関連の構文は、[Rule Syntax]タブの

[Categories]フィールドの[Parameters]をクリックすると表示される、[Functions]フィールドのリスト内にあ

ります。

Parameter("manifold_block:1", "block") = block

Parameter("manifold_block:1", "component_type") = component_type

Parameter("manifold_block:1", "port_a_size") = port_a_size

Parameter("manifold_block:1", "port_b_size") = port_b_size

Parameter("manifold_block:1", "port_c_size") = port_c_size

ここでは、アセンブリのパラメータのパラメータ値の出力先に、パーツコンポーネント[manifold_block:1]のパラ

メータを指定しています。

4. [OK]ボタンをクリックして、ダイアログを閉じます。

これで、コンポーネントへのパスのルールのプログラム作成は完了しました。

ポートのサイズ構成のルール

パラメータの作成段階では、[port_a_size]、[port_b_size]、[port_c_size]パラメータを作成して、パラメータ値

を割り当てました。これから、これらのパラメータとパラメータ値を構文に使用して、ポートのサイズ構成のルー

ルのプログラムを作成します。

パラメータエディタの[Multi-Value]リストでパラメータ値[standard]を選択すると、チュートリアル Part 2 で作成

したパーツコンポーネント「manifold_block:1」のルールを実行して、他のポートをポート A と同じサイズに強

制的に変更できる、そんな動作のルールを実行できるようにします。

ルールのプログラムの作成

1. [モデル]ブラウザの[manifold_block:1]をダブルクリックして、コンポーネントをアクティブにします。

2. [管理]タブの[iLogic]パネル から[Edit iLogic Tree]ツールをクリックして、[iLogic Tree]ダイアログを表示

します。

Page 15: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

15 / 33

3. [component_type_rule]をダブルクリックして、[Edit Rule]ダイアログを表示します。

4. テキストフィールドに表示されたプログラムの構文をコピーし、[OK]ボタンをクリックして[Edit Rule]ダイア

ログを閉じます。

5. [OK]ボタンをクリックして、[iLogic Tree]ダイアログを閉じます。

6. [モデル]ブラウザの[my_manifold_block.iam]をダブルクリックして、アセンブリをアクティブにします。

7. [iLogic]パネルの[Add Rule]ツールをクリックして、[Rule Name]ダイアログを表示します。

8. [Name]フィールドにルール名「component_type_rule」を入力し、[OK]ボタンをクリックして、[Edit Rule]ダ

イアログを表示します。

9. 先にコピーしたプログラムの構文をテキストフィールドに貼り付けます。

If component_type = "standard" Then

port_b_size = port_a_size

port_c_size = port_a_size

End If

10. [OK]ボタンをクリックして[Edit Rule]ダイアログを閉じます。

これで、ポートのサイズ構成のルールのプログラム作成は完了しました。

ポート A のルール

アセンブリのパラメータの作成段階では、[port_a_size]パラメータを作成して、[Multi-Value]リストにパラメータ

値を割り当てました。これから、このパラメータとパラメータ値を構文に使用して、ポート A のルールのプログ

ラムを作成します。

パラメータエディタの[Multi-Value]リストでパラメータ値を選択すると、ポート A のサイズに合わせて、ポート A

のユニオンキャップとボルトが、iPart テーブルを参照してサイズや部品番号を変更する、そんな動作のルー

ルを実行できるようにします。

ルールのプログラムの作成

1. [iLogic]パネルの[Add Rule]ツールをクリックして、[Rule Name]ダイアログを表示します。

2. [Name]フィールドにルール名「port_a_rule」を入力し、[OK]ボタンをクリックして、[Edit Rule]ダイアログを

表示します。

3. テキストフィールドに、次の通りに構文を入力します。iPart 関連の構文は、[Rule Syntax]タブの

[Categories]フィールドの[iParts]をクリックすると表示される、[Functions]フィールドのリスト内にあります。

i = iPart.FindRow("port_a_union", "port_size", "=", port_a_size)

port_a_y_dist_between_screws = iPart.CurrentRowValue("y_dist_betwn_screw")

Page 16: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

16 / 33

port_a_x_dist_between_screws = iPart.CurrentRowValue("x_dist_betwn_screw")

ここでは、アセンブリの[port_a_size]パラメータに対応する、パーツコンポーネント[port_a_union]のパラメー

タが参照する iPart テーブルの列を指定しています。

4. テキストフィールドに、次の通りに構文を入力します。

If port_a_size = .50 Then

iPart.ChangeRow("port_a_union_screw", "Screw-01")

ElseIf port_a_size = 0.75 Then

iPart.ChangeRow("port_a_union_screw", "Screw-02")

ElseIf port_a_size = 1.00 Then

iPart.ChangeRow("port_a_union_screw", "Screw-02")

ElseIf port_a_size = 1.25 Then

iPart.ChangeRow("port_a_union_screw", "Screw-03")

ElseIf port_a_size = 1.50 Then

iPart.ChangeRow("port_a_union_screw", "Screw-04")

ElseIf port_a_size = 2.00 Then

iPart.ChangeRow("port_a_union_screw", "Screw-04")

ElseIf port_a_size = 2.50 Then

iPart.ChangeRow("port_a_union_screw", "Screw-05")

ElseIf port_a_size = 3.00 Then

iPart.ChangeRow("port_a_union_screw", "Screw-06")

End If

ここでは、アセンブリの[port_a_size]パラメータのパラメータ値が[0.50]、[0.75]、[1.00]、[1.25]、[1.50]、[2.00]、

[2.50]、[3.00]のときの、パーツコンポーネント[port_a_union_screw]のパラメータが参照する iPart テーブル

の行を指定しています。

テキストフィールドに、次の通りに構文を入力します。

port_a_union_part_number = iProperties.Value("port_a_union", "Project", "Part Number")

ここでは、パーツコンポーネント[port_a_union]の部品番号の出力先を指定しています。

5. [OK]ボタンをクリックしてダイアログを閉じてから、アセンブリドキュメントを保存します。

これで、ポート A のルールのプログラム作成は完了しました。

Page 17: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

17 / 33

ポート B のルール

アセンブリのパラメータの作成段階では、[port_b_size]パラメータを作成して、パラメータ値を割り当てました。

これから、このパラメータとパラメータ値を構文に使用して、ポート B のルールのプログラムを作成します。

パラメータエディタの[component_type]行の[Multi-Value]リストでパラメータ値[standard]を選択し、

[port_b_size]行の[Multi-Value]リストでパラメータ値を選択すると、ポート B のサイズに合わせて、ポート B

のユニオンキャップとボルトが、iPart テーブルを参照してサイズや部品番号を変更する、パラメータ値[elbow]

を選択すると、ポート B のユニオンキャップとボルトが省略される、そんな動作のルールを実行できるようにし

ます。

このルールの実行で、iLogic にエラーメッセージを表示させないようにするためにも、まず、iLogic 用のカスタ

ム詳細レベルリプレゼンテーションを作成します。

詳細レベルリプレゼンテーションの作成

1. [モデル]ブラウザの[詳細レベル]を右クリックしてメニューを表示し、[新規詳細レベル]を選択します。これ

で、ノード[詳細レベル 1]が新規作成されます。

2. 新規作成されたノードの名前[詳細レベル 1]を[iLogic]に変更します。

Page 18: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

18 / 33

ルールのプログラムの作成

1. [iLogic]パネルの[Add Rule]ツールをクリックして、[Rule Name]ダイアログを表示します。

2. [Name]フィールドにルール名「port_b_rule」を入力し、[OK]ボタンをクリックして、[Edit Rule]ダイアログを

表示します。

3. テキストフィールドに、次の通りに構文を入力します。

If block = "elbow" Then

isTee = False

Else

isTee = True

End If

ここでは、アセンブリの[block]パラメータのパラメータ値が[elbow]のときには、[isTee]パラメータを無効にする、

そうでないときは有効にすることを指定しています。

4. テキストフィールドに、次の通りに構文を入力します。

Page 19: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

19 / 33

Constraint.IsActive("port_b_cap_center") = isTee

Constraint.IsActive("port_b_cap_hole") = isTee

Constraint.IsActive("port_b_cap_face") = isTee

Constraint.IsActive("port_b_cap_screw") = isTee

ここでは、[isTee]パラメータが有効のときにアクティブ化する拘束パラメータを指定しています。[isTee]パラメ

ータが無効のときは、これらの拘束パラメータはすべて省略されます。

5. テキストフィールドに、次の通りに構文を入力します。

Component.IsActive("port_b_union") = isTee

Component.IsActive("port_b_screw_pattern") = isTee

ここでは、[isTee]パラメータが有効のときにアクティブ化するコンポーネントとパターンコンポーネントを指定し

ています。[isTee]パラメータが無効のときは、これらのコンポーネントとパターンコンポーネントはすべて省略

されます。

6. テキストフィールドに、次の通りに構文を入力します。

if isTee Then

i = iPart.FindRow("port_b_union", "port_size", "=", port_b_size)

port_b_y_dist_between_screws = iPart.CurrentRowValue("y_dist_betwn_screw")

port_b_x_dist_between_screws = iPart.CurrentRowValue("x_dist_betwn_screw")

port_b_union_part_number = iProperties.Value("port_b_union", "Project", "Part

Number")

Page 20: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

20 / 33

End If

ここでは、[isTee]パラメータが有効のとき、アセンブリの[port_b_size]パラメータに対応する、パーツコンポー

ネント[port_b_union]のパラメータが参照する iPart テーブルの列と部品番号の出力先を指定しています。

[isTee]パラメータが無効のときは、このパートは実行されません。

7. テキストフィールドに、次の通りに構文を入力します。

If port_b_size = .50 then

iPart.ChangeRow("port_b_union_screw", "Screw-01")

elseif port_b_size = .75 then

iPart.ChangeRow("port_b_union_screw", "Screw-02")

elseif port_b_size = 1.00 then

iPart.ChangeRow("port_b_union_screw", "Screw-02")

elseif port_b_size = 1.25 then

iPart.ChangeRow("port_b_union_screw", "Screw-03")

elseif port_b_size = 1.50 then

iPart.ChangeRow("port_b_union_screw", "Screw-04")

elseif port_b_size = 2.00 then

iPart.ChangeRow("port_b_union_screw", "Screw-04")

elseif port_b_size = 2.50 then

iPart.ChangeRow("port_b_union_screw", "Screw-05")

elseif port_b_size = 3.00 then

iPart.ChangeRow("port_b_union_screw", "Screw-06")

end if

ここでは、アセンブリの[port_b_size]パラメータのパラメータ値が[0.50]、[0.75]、[1.00]、[1.25]、[1.50]、[2.00]、

[2.50]、[3.00]のときに、パーツコンポーネント「port_b_union_screw」のモデルパラメータが参照する iPart テ

ーブル行を指定しています。[isTee]パラメータが無効のときは、このパートは実行されません。

8. [OK]ボタンをクリックして、ダイアログを閉じます。

これで、ポート B のルールのプログラム作成は完了しました。

ポート C のルール

アセンブリのパラメータの作成段階では、[port_c_size]パラメータを作成して、パラメータ値を割り当てました。

これから、このパラメータとパラメータ値を構文に使用して、ポート C のルールのプログラムを作成します。こ

のルールは、先に作成したポート A のルールと同じ内容ですので、ポート A のプログラムをコピー&ペースト

Page 21: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

21 / 33

し、修正を加えて作成します。

パラメータエディタの[Multi-Value]リストでパラメータ値を選択すると、ポート C のサイズに合わせて、ポート C

のユニオンキャップとボルトが、iPart テーブルを参照してサイズや部品番号を変更する、そんな動作のルー

ルを実行できるようにします。

ルールのプログラムの作成

1. [iLogic]パネルの[edit iLogic Tree]ツールをクリックして、[iLogic Tree]ダイアログを表示します。

2. [port_a_rule]をダブルクリックして、[Edit Rule]ダイアログを表示します。

3. テキストフィールドに表示されたプログラムの構文をコピーし、[OK]ボタンをクリックして[Edit Rule]ダイア

ログを閉じます。

4. [OK]ボタンをクリックして、ダイアログを閉じます。

5. [iLogic]パネルの[Add Rule]ツールをクリックして、[Rule Name]ダイアログを表示します。

6. [Name]フィールドにルール名「port_c_rule」を入力し、[OK]ボタンをクリックして、[Edit Rule]ダイアログを

表示します。

7. 先にコピーしたプログラムの構文をテキストフィールドに貼り付けます。

8. [Search and Replace]タブをクリックして内容を表示し、[Find what]フィールドには「port_a」を入力し、

[Replace with]フィールドには「port_c」を入力します。

9. [Replace All in This Rule]ボタンをクリックします。これで、テキストフィールドの構文内の文字列

「port_a」が、すべて「port_c」に置換されます。

10. [OK]ボタンをクリックしてダイアログを閉じてから、アセンブリドキュメントを保存します。

これで、ポート C のルールのプログラム作成は完了しました。

ボルトの部品番号のルール

部品番号のパラメータの作成段階では、ボルトの部品番号のパラメータを作成しました。これから、このパラメ

ータを構文に使用して、部品番号のルールのプログラムを作成します。

ポートのサイズを変更すると、それに対応したサイズのボルトの部品番号を出力する、そんな動作のルールを

実行できるようにします。

Page 22: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

22 / 33

ルールのプログラムの作成

1. [iLogic]パネルの[Add Rule]ツールをクリックして、[Rule Name]ダイアログを表示します。

2. [Name]フィールドにルール名「screw_part_number_rule」を入力し、[OK]ボタンをクリックして、[Edit

Rule]ダイアログを表示します。

3. テキストフィールドに、次の通りに構文を入力します。キーワード[Select Case]と[Case]は、[Rule

Syntax]タブの[keywords]フィールドのリスト内にあります。

Select Case port_a_size

Case .50

Screw_num1 = 050

Case .75

Screw_num1 = 075

Case 1.00

Screw_num1 = 100

Case 1.25

Screw_num1 = 125

Case 1.50

Screw_num1 = 150

Case 2.00

Screw_num1 = 200

Case 2.50

Screw_num1 = 250

Case 3.00

Screw_num1 = 300

End Select

port_a_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"

ここでは、アセンブリの[port_a_size]パラメータのパラメータ値が[0.50]、[0.75]、[1.00]、[1.25]、[1.50]、[2.00]、

[2.50]、[3.00]のときに、[port_a_screw_part_number]パラメータに出力する部品番号(UNBRAKO-

[Screw_num1]パラメータのパラメータ値-SCREW)を指定しています。

4. テキストフィールドに、次の通りに構文を入力します。

Select Case port_b_size

Case .50

Screw_num1 = 050

Case .75

Page 23: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

23 / 33

Screw_num1 = 075

Case 1.00

Screw_num1 = 100

Case 1.25

Screw_num1 = 125

Case 1.50

Screw_num1 = 150

Case 2.00

Screw_num1 = 200

Case 2.50

Screw_num1 = 250

Case 3.00

Screw_num1 = 300

End Select

port_b_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"

ここでは、アセンブリの[port_b_size]パラメータのパラメータ値が[0.50]、[0.75]、[1.00]、[1.25]、[1.50]、[2.00]、

[2.50]、[3.00]のときに、[port_b_screw_part_number]パラメータに出力する部品番号(UNBRAKO-

[Screw_num1]パラメータのパラメータ値-SCREW)を指定しています。

5. テキストフィールドに、次の通りに構文を入力します。

Select Case port_c_size

Case .50

Screw_num1 = 050

Case .75

Screw_num1 = 075

Case 1.00

Screw_num1 = 100

Case 1.25

Screw_num1 = 125

Case 1.50

Screw_num1 = 150

Case 2.00

Screw_num1 = 200

Case 2.50

Screw_num1 = 250

Case 3.00

Screw_num1 = 300

Page 24: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

24 / 33

End Select

port_c_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"

ここでは、アセンブリの[port_c_size]パラメータのパラメータ値が[0.50]、[0.75]、[1.00]、[1.25]、[1.50]、[2.00]、

[2.50]、[3.00]のときに、[port_b_screw_part_number]パラメータに出力する部品番号(UNBRAKO-

[Screw_num1]パラメータのパラメータ値-SCREW)を指定しています。

6. [OK]ボタンをクリックしてダイアログを閉じてから、アセンブリドキュメントを保存します。

これで、ボルトの部品番号のルールのプログラム作成は完了しました。

Excel スプレッドシート更新のルール

これまで、Excel スプレッドシートのパラメータ値を参照して、モデルのパラメータ値の更新を実行するルール

を作成しましたが、これとは逆に、モデルのパラメータ値を参照して、Excel のスプレッドシートのパラメータ値

を更新するルールを作成することも可能です。これから、サンプルデータ「part_number.xls」を使用して、ルー

ルを実行して更新されたパラメータ値を参照して、Excel スプレッドシートのパラメータ値の更新を実行する、

Excel スプレッドシート更新のルールのプログラムを作成していきます。

ルールのプログラムの作成

1. [iLogic]パネルの[Add Rule]ツールをクリックして、[Rule Name]ダイアログを表示します。

2. [Name]フィールドにルール名「update_excel_spreadsheet_rule」を入力し、[OK]ボタンをクリックして、

[Edit Rule]ダイアログを表示します。

3. テキストフィールドに、次の通りに構文を入力します。

Page 25: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

25 / 33

GoExcel.CellValue("part_number.xls", "Sheet1", "Block_Type") = component_type

GoExcel.CurrentCellValue("Block_Style") = block

GoExcel.CurrentCellValue("Block_Part_Number") = iProperties.Value("manifold_block:1",

"Project", "Part Number")

ここでは、アセンブリのパラメータ値の出力先と、パーツコンポーネント[manifold_block:1]の部品番号の出力

先に、Excel ファイル「part_number.xls」のスプレッドシートのセルを指定しています。

4. テキストフィールドに、次の通りに構文を入力します。

GoExcel.CurrentCellValue("port_a_size") = port_a_size

If block = "tee" Then

GoExcel.CurrentCellValue("port_b_size") = port_b_size

Else

GoExcel.CurrentCellValue("port_b_size") = "N/A"

End If

GoExcel.CurrentCellValue("port_c_size") = port_c_size

ここでは、アセンブリの[block]パラメータのパラメータ値が[tee]もしくは[tee]以外のときの、各ポートのパラメー

タのパラメータ値の出力先に、Excel ファイル「part_number.xls」のスプレッドシートのセルを指定しています。

5. テキストフィールドに、次の通りに構文を入力します。

GoExcel.CurrentCellValue("block_depth") = Parameter("manifold_block:1",

"block_depth")

GoExcel.CurrentCellValue("block_width") = Parameter("manifold_block:1",

"block_width")

GoExcel.CurrentCellValue("block_height") = Parameter("manifold_block:1",

"block_height")

ここでは、パーツコンポーネント[manifold_block:1]のパラメータのパラメータ値の出力先に、Excel ファイル

「part_number.xls」のスプレッドシートのセルを指定しています。

6. テキストフィールドに、次の通りに構文を入力します。

GoExcel.CurrentCellValue("port_a_union_cap") = port_a_union_part_number

GoExcel.CurrentCellValue("port_a_screw_kit") = port_a_screw_part_number

If block = "tee"Then

GoExcel.CurrentCellValue("port_b_union_cap") = port_b_union_part_number

Page 26: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

26 / 33

GoExcel.CurrentCellValue("port_b_screw_kit") = port_b_screw_part_number

Else

GoExcel.CurrentCellValue("port_b_union_cap") = "N/A"

GoExcel.CurrentCellValue("port_b_screw_kit") = "N/A"

End If

GoExcel.CurrentCellValue("port_c_union_cap") = port_c_union_part_number

GoExcel.CurrentCellValue("port_c_screw_kit") = port_c_screw_part_number

ここでは、アセンブリの[block]パラメータのパラメータ値が[tee]もしくは[tee]以外のときの、各ポートのユニオ

ンキャップとボルトの部品番号の出力先に、Excel ファイル「part_number.xls」のスプレッドシートの各セルを

指定しています。

7. テキストフィールドに、次の通りに構文を入力します。

GoExcel.Save

ここでは、Excel スプレッドシートの保存を指定しています。

8. [OK]ボタンをクリックしてダイアログを閉じてから、アセンブリドキュメントを保存します。

これで、Excel スプレッドシート更新のルールのプログラム作成は完了しました。

ルールを実行する

アセンブリのパラメータエディタでパラメータ値を選択して、これまでに作成したルールが、意図した通りに動

作するかテストを行います。

1. [管理]タブの[パラメータ]パネルから[iLogic Parameters]ツールをクリックして、[Parameter Editor]ダイア

ログを表示します。

2. [block]行の[Multivalue]列のセルをクリックしてドロップダウンリストを表示し、[tee]から[elbow]に変更しま

す。パラメータ値[elbow]を選択すると、マニホールドブロックの回路がエルボタイプになって B ポートが省

略されるのに合わせて、ユニオンキャップやボルトが省略されることを確認してください。

Page 27: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

27 / 33

3. [port_a_size]行の[Multivalue]列のセルをクリックしてドロップダウンリストを表示し、[0.75]を選択してか

ら適当な空白セルをクリックします。パラメータ値[0.75]を選択すると、各ポートとブロックのサイズが変更

されるのに合わせて、ユニオンキャップとボルトのサイズが変更されます。

4. プロジェクトフォルダ内の Excel ファイル「PartNumber.xls」を開きます。ポートのサイズの変更によって、

Excel スプレッドシートの内容が更新されていることを確認してください。

Page 28: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

28 / 33

これで、アセンブリのルールの実行はすべて完了しました。

これをもって、iLogic チュートリアル Part 3 のカリキュラムはすべて完了しました。

最後に、アセンブリドキュメントを保存して閉じます。

これで、iLogic チュートリアルはすべて終了です。

付録 ルールのプログラム全文

コンポーネントへのパスのルール

Parameter("manifold_block:1", "block") = block

Parameter("manifold_block:1", "component_type") = component_type

Parameter("manifold_block:1", "port_a_size") = port_a_size

Parameter("manifold_block:1", "port_b_size") = port_b_size

Parameter("manifold_block:1", "port_c_size") = port_c_size

コンポーネントのタイプのルール

If component_type = "standard" Then

port_b_size = port_a_size

port_c_size = port_a_size

End If

ポート A のルール

i = iPart.FindRow("port_a_union", "port_size", "=", port_a_size)

port_a_y_dist_between_screws = iPart.CurrentRowValue("y_dist_betwn_screw")

port_a_x_dist_between_screws = iPart.CurrentRowValue("x_dist_betwn_screw")

If port_a_size = .50 Then

iPart.ChangeRow("port_a_union_screw", "Screw-01")

ElseIf port_a_size = 0.75 Then

iPart.ChangeRow("port_a_union_screw", "Screw-02")

ElseIf port_a_size = 1.00 Then

iPart.ChangeRow("port_a_union_screw", "Screw-02")

Page 29: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

29 / 33

ElseIf port_a_size = 1.25 Then

iPart.ChangeRow("port_a_union_screw", "Screw-03")

ElseIf port_a_size = 1.50 Then

iPart.ChangeRow("port_a_union_screw", "Screw-04")

ElseIf port_a_size = 2.00 Then

iPart.ChangeRow("port_a_union_screw", "Screw-04")

ElseIf port_a_size = 2.50 Then

iPart.ChangeRow("port_a_union_screw", "Screw-05")

ElseIf port_a_size = 3.00 Then

iPart.ChangeRow("port_a_union_screw", "Screw-06")

End If

port_a_union_part_number = iProperties.Value("port_a_union", "Project", "Part Number")

ポート B のルール

If block = "elbow" Then

isTee = False

Else

isTee = True

End If

Constraint.IsActive("port_b_cap_center") = isTee

Constraint.IsActive("port_b_cap_hole") = isTee

Constraint.IsActive("port_b_cap_face") = isTee

Constraint.IsActive("port_b_cap_screw") = isTee

Component.IsActive("port_b_union") = isTee

Component.IsActive("port_b_screw_pattern") = isTee

if isTee Then

i = iPart.FindRow("port_b_union", "port_size", "=", port_b_size)

port_b_y_dist_between_screws = iPart.CurrentRowValue("y_dist_betwn_screw")

port_b_x_dist_between_screws = iPart.CurrentRowValue("x_dist_betwn_screw")

port_b_union_part_number = iProperties.Value("port_b_union", "Project", "Part

Number")

End If

If port_b_size = .50 then

iPart.ChangeRow("port_b_union_screw", "Screw-01")

Page 30: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

30 / 33

elseif port_b_size = .75 then

iPart.ChangeRow("port_b_union_screw", "Screw-02")

elseif port_b_size = 1.00 then

iPart.ChangeRow("port_b_union_screw", "Screw-02")

elseif port_b_size = 1.25 then

iPart.ChangeRow("port_b_union_screw", "Screw-03")

elseif port_b_size = 1.50 then

iPart.ChangeRow("port_b_union_screw", "Screw-04")

elseif port_b_size = 2.00 then

iPart.ChangeRow("port_b_union_screw", "Screw-04")

elseif port_b_size = 2.50 then

iPart.ChangeRow("port_b_union_screw", "Screw-05")

elseif port_b_size = 3.00 then

iPart.ChangeRow("port_b_union_screw", "Screw-06")

end if

ポート C のルール

i = iPart.FindRow("port_c_union", "port_size", "=", port_c_size)

port_c_y_dist_between_screws = iPart.CurrentRowValue("y_dist_betwn_screw")

port_c_x_dist_between_screws = iPart.CurrentRowValue("x_dist_betwn_screw")

If port_c_size = .50 Then

iPart.ChangeRow("port_c_union_screw", "Screw-01")

ElseIf port_c_size = 0.75 Then

iPart.ChangeRow("port_c_union_screw", "Screw-02")

ElseIf port_c_size = 1.00 Then

iPart.ChangeRow("port_c_union_screw", "Screw-02")

ElseIf port_c_size = 1.25 Then

iPart.ChangeRow("port_c_union_screw", "Screw-03")

ElseIf port_c_size = 1.50 Then

iPart.ChangeRow("port_c_union_screw", "Screw-04")

ElseIf port_c_size = 2.00 Then

iPart.ChangeRow("port_c_union_screw", "Screw-04")

ElseIf port_c_size = 2.50 Then

iPart.ChangeRow("port_c_union_screw", "Screw-05")

ElseIf port_c_size = 3.00 Then

iPart.ChangeRow("port_c_union_screw", "Screw-06")

End If

Page 31: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

31 / 33

port_c_union_part_number = iProperties.Value("port_c_union", "Project", "Part Number")

部品番号のルール

Select Case port_a_size

Case .50

Screw_num1 = 050

Case .75

Screw_num1 = 075

Case 1.00

Screw_num1 = 100

Case 1.25

Screw_num1 = 125

Case 1.50

Screw_num1 = 150

Case 2.00

Screw_num1 = 200

Case 2.50

Screw_num1 = 250

Case 3.00

Screw_num1 = 300

End Select

port_a_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"

Select Case port_b_size

Case .50

Screw_num1 = 050

Case .75

Screw_num1 = 075

Case 1.00

Screw_num1 = 100

Case 1.25

Screw_num1 = 125

Case 1.50

Screw_num1 = 150

Case 2.00

Screw_num1 = 200

Page 32: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

32 / 33

Case 2.50

Screw_num1 = 250

Case 3.00

Screw_num1 = 300

End Select

port_b_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"

Select Case port_c_size

Case .50

Screw_num1 = 050

Case .75

Screw_num1 = 075

Case 1.00

Screw_num1 = 100

Case 1.25

Screw_num1 = 125

Case 1.50

Screw_num1 = 150

Case 2.00

Screw_num1 = 200

Case 2.50

Screw_num1 = 250

Case 3.00

Screw_num1 = 300

End Select

port_c_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"

Excel スプレッドシート更新のルール

GoExcel.CellValue("part_number.xls", "Sheet1", "Block_Type") = component_type

GoExcel.CurrentCellValue("Block_Style") = block

GoExcel.CurrentCellValue("Block_Part_Number") = iProperties.Value("manifold_block:1",

"Project", "Part Number")

GoExcel.CurrentCellValue("port_a_size") = port_a_size

If block = "tee" Then

GoExcel.CurrentCellValue("port_b_size") = port_b_size

Page 33: Autodesk Inventor iLogic チュートリアル Part 3images.autodesk.com/apac_japan_main/files/ilogic_2010...Autodesk Inventor 2010 Inventor iLogic Extension 2 / 33 チュートリアルPart

Autodesk Inventor 2010

Inventor iLogic Extension

33 / 33

Else

GoExcel.CurrentCellValue("port_b_size") = "N/A"

End If

GoExcel.CurrentCellValue("port_c_size") = port_c_size

GoExcel.CurrentCellValue("block_depth") = Parameter("manifold_block:1",

"block_depth")

GoExcel.CurrentCellValue("block_width") = Parameter("manifold_block:1",

"block_width")

GoExcel.CurrentCellValue("block_height") = Parameter("manifold_block:1",

"block_height")

GoExcel.CurrentCellValue("port_a_union_cap") = port_a_union_part_number

GoExcel.CurrentCellValue("port_a_screw_kit") = port_a_screw_part_number

If block = "tee"Then

GoExcel.CurrentCellValue("port_b_union_cap") = port_b_union_part_number

GoExcel.CurrentCellValue("port_b_screw_kit") = port_b_screw_part_number

Else

GoExcel.CurrentCellValue("port_b_union_cap") = "N/A"

GoExcel.CurrentCellValue("port_b_screw_kit") = "N/A"

End If

GoExcel.CurrentCellValue("port_c_union_cap") = port_c_union_part_number

GoExcel.CurrentCellValue("port_c_screw_kit") = port_c_screw_part_number

GoExcel.Save

Autodesk Inventor は、米国 Autodesk, Inc.の米国およびその他の国における商標または

登録商標です。その他記載の会社名、ブランド名および商品名は、各社の商標または登録

商標です。

記載事項は、予告なく変更することがございます。予めご了承ください。

©2009 Autodesk, Inc. All rights reserved.


Top Related