対話入力と選択:点・数値・文字・図形選択・仮表示を独自コマンドで使う
操作スキーマは実装から取得して生成しています。必須引数、型、null許可はJSON Schema、既定値と.NETの正式な型名は下段の公開契約を参照してください。JSONのプロパティ名はcamelCase、C#/VB.NETのプロパティ名はPascalCaseです。型はJDesignCAD.Api名前空間にあります。
インターフェース
| 型 | 追加機能 |
|---|---|
| ICadApi | GetDocumentAsync、GetSelectionAsync、CreateGeometryAsync、UndoAsync、RedoAsync |
| ICadModelApi : ICadApi | GetEntitiesAsync、GetEntityDetailsAsync、SetSelectionAsync、CreateCurvesAsync、TranslateEntitiesAsync、DeleteEntitiesAsync |
| ICadAutomationApi : ICadModelApi | GetCapabilitiesAsync、GetOperationSchemaAsync、GetTopologyAsync、GetAttributesAsync、GetLayersAsync、ExecuteOperationAsync |
| ICadJobApi : ICadAutomationApi | StartOperationAsync、GetJobAsync、CancelJobAsync、CommitJobAsync |
| ICadWorkspaceApi : ICadJobApi | QueryAsync、GetJobDataAsync |
| ICadInteractionApi : ICadWorkspaceApi | GetInteractiveCommandsAsync、LaunchInteractiveCommandAsync |
| ICadFileApi : ICadInteractionApi | 保存・書き出し、形式一覧、完了・中止(5メソッド) |
| ICadInputApi : ICadInteractionApi | 独自の点・数値・文字・選択入力、仮表示、範囲選択。GetPointAsync等は拡張メソッド。 |
| ICadAddin / IAddinContext / IAddinCommand | 起動・終了、タブ登録、ボタン実行。IAddinContext.ApiはICadApi。is/TryCastで追加インターフェースを確認。 |
| LocalCadClient | ICadFileApiとICadInputApiを実装。同じWindowsユーザーの明示したSessionInfoへ接続。LocalProtocol.FindSessionsで取得。 |
図面・ID・トランザクション
DocumentInfo.Idは開いている図面のセッションID、Revisionは変更を検出する番号です。EntityInfo.Idはトップレベル図形の一時的な識別子で、保存して再起動した図面には使えません。SubobjectRefはEntityId・Revision・Kind(face/edge/vertex)・Indexからなり、revision変更後は再取得が必要です。
図形変更は要求1件につき1回のUndoです。選択・情報取得・計算だけではUndoを増やしません。変更リクエストのOperationIdは新しいUUID(D形式)。同じIDの異なる入力はoperation_conflictになります。即時操作の再試行履歴は直近256件、ジョブ情報は約32件以内の保持で、ウィンドウ終了・図面変更で失効します。Undo/Redoは手動編集を含む直前の履歴が対象です。
単位・上限
| 対象 | 規則 |
|---|---|
| 座標・角度 | WCS mm、度。右手系。有限値、座標の絶対値は10億mm以内。 |
| 図形作成・変換 | 最大1000図形。点列を含む即時作成・更新は合計4096点。線・面の一括編集は操作ごとの上限あり。 |
| 情報取得 | 一覧1~1000件、詳細1~100 ID、トポロジー/結果1~256件。Offsetは0始まり。 |
| 曲線 | 正規化パラメータ0~1。トリムは0≦start<end≦1。円弧のsweepは符号付き・360度未満。閉ポリラインは最初の点を最後へ重複させない。 |
| 計算ジョブ | 入力100図形まで。running/readyは最大4件、同時実行は1件。実行タイムアウト1~1800秒(待ち行列の時間を除く)。 |
| 通信 | 1メッセージ1 MiB。巨大な入力・入れ子の結果は上限に達する場合がある。件数を減らすか、DLL経由の利用を検討。 |
| 色・線 | CadColor.ModeはbyLayer/byBlock/foreground/rgb。rgbのRgbは6桁16進数。foregroundは背景に応じて反転。レイヤー色はforeground/rgbのみ。 |
読み取り
GetEntityDetailsAsyncは従来の線分・円・円弧・ポリライン向けです。QueryAsyncのKind="geometry"は楕円、スプラインの極点・節点・重み、文字、点、ブロック属性・ダイナミック値も返します。返却statusがunsupported/too_largeなら定義の取得はできていません。図形種別・範囲は引き続き取得できます。
QueryAsyncのKind="blocks"は定義(最大1000)とアクティブモデル直下の挿入数、"styles"は寸法・ハッチスタイル名です。"sheet"は板金状態、ルール、曲げ番号、成形ID、ロフト寸法を返します。保存用の巨大なBRep履歴は返しません。図面内の全入れ子ブロックの再帰的な集計は含みません。
ジョブの状態
| State | 意味・次の呼出し |
|---|---|
| running | 待機中または計算中。GetJobAsyncで確認。CancelJobAsyncで中止。 |
| ready | 図形結果を保持。CommitJobAsyncで1回のUndoとして反映、またはCancelJobAsyncで破棄。 |
| committed | 反映済み。同じcommit要求は再試行可能。別のOperationIdで二重確定は不可。 |
| completed | 計測・解析結果。GetJobDataAsyncでページ取得。図面へのcommitは不要。 |
| failed / cancelled | ErrorCode・Messageを確認。図面は計算前の状態を保持。 |
板金・解析の値
| 引数 | 意味 |
|---|---|
| SheetRules.ReliefType | 0=矩形、1=丸、2=なし。板厚・半径・逃げ幅・深さは正の値、KFactorは0~1。 |
| SheetPlateParameters.ThicknessSide | 0=輪郭法線側、1=反対側、2=両側へ半分。 |
| SheetLoftDimensions.Kind | 0=ロール、1=丸―丸、2=角―丸、3=角―角。 |
| FormingMode / SeamMode | FormingMode: 0=分割曲げ、1=滑らか。SeamMode: 0=自動、1=SeamAngleで位置指定。角RはCornerRadius/TopCornerRadius。 |
| PositionReference / LengthReference | PositionReference: 0=曲げ開始の接線、1=内側仮想交点、2=外側仮想交点、3=曲げ中心(K係数を使用)。LengthReference: 0=直線部、1=内側寸法、2=外側寸法。 |
| SheetFormDimensions.Kind | 0=バーリング、1=ダボ、2=エンボス、3=ビード、4=ルーバー、5=円形絞り、6=角形絞り、7=ブリッジ。Diameterはルーバーの平らな頂部の奥行き/角形の底面幅/ブリッジ頂部長さ、Spanは直線部/底面長さ/ブリッジ幅。CornerRadiusは角形底面の平面角R(既定1)、BridgeHoleDiameterは中央穴径(既定0=なし)。追加のinitプロパティなので既存コンストラクターは変更していません。外形や板厚による成立条件あり。絞りの展開は基準平板への復帰で、製造用ブランク寸法の算定ではありません。 |
| SheetManageBendParameters.Operation | 0=抑制、1=復元、2=削除、3=親変更。ParentIndex=-1は基本板。 |
| 解析 | 2D 8節点、3D 10/20節点の2次要素。節点番号は0始まり。analysis.mesh/solveは単一材料、analysis.assembly.*は部品別材料・接合設定に対応。Kind=elastic/heat。材料はN/mm²、kg/m³、W/(m K)、J/(kg K)。条件の力N、面荷重N/mm²、熱流束W/mm²、対流係数W/(mm² K)。2Dメッシュの座標系はsummaryのOrigin・AxisX・AxisYを参照。 |
エラー
DLLはCadApiException.Code、MCPは同じコードを含むエラーを返します。invalid_argument(入力)、unsupported_operation/unsupported_geometry(対象外)、no_document/unsupported_view/cad_busy、document_changed/revision_conflict、entity_not_found/entity_not_in_model、layer_locked/undo_disabled、operation_conflict、license_required、job_limit/job_not_ready/job_not_found、worker_unavailable/worker_failed/operation_timeout/geometry_failed/invalid_result、message_too_largeを処理してください。値を変更せず同じ失敗を繰り返さないでください。
構造化操作一覧
immediate → ExecuteOperationAsync。worker → StartOperationAsync→CommitJobAsync。worker-data → StartOperationAsync→GetJobDataAsync。板金・解析はSTD/Pro。以下の「公開」はエンジンが全形状で成功するという保証ではありません。
01 設定・属性
attributes.set — 図形のレイヤー・色・線種・線幅を変更 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
layer | 省略可 | string / null |
color | 省略可 | object / null |
linePattern | 省略可 | string / null |
lineWidth | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"layer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"color": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"rgb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"mode"
]
},
{
"type": "null"
}
]
},
"linePattern": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"lineWidth": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"entityIds"
]
}layers.delete — 未使用レイヤーを削除 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
}layers.set — レイヤー作成・属性変更・カレント設定 immediate
入力型: SetLayerParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
color | 省略可 | object / null |
locked | 省略可 | boolean / null |
transparency | 省略可 | integer / null |
makeCurrent | 省略可 | boolean |
linePattern | 省略可 | string / null |
lineWidth | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"color": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"rgb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"mode"
]
},
{
"type": "null"
}
]
},
"locked": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"transparency": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"makeCurrent": {
"type": "boolean"
},
"linePattern": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"lineWidth": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"name"
]
}styles.linePattern — 線種定義を登録・更新 immediate
Patternは線・隙間の正の長さを交互に指定。偶数個。空配列は実線。Scaleはlayout/world/device。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("styles.linePattern",
new LinePatternParameters("破線 4-2", [4, 2], MakeCurrent: true), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
pattern | 必須 | array of number |
makeCurrent | 省略可 | boolean |
scale | 省略可 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"pattern": {
"type": "array",
"items": {
"type": "number"
}
},
"makeCurrent": {
"type": "boolean"
},
"scale": {
"type": "string"
}
},
"required": [
"name",
"pattern"
]
}styles.lineWidth — 線幅定義を登録・更新 immediate
入力型: LineWidthParameters
同名の定義を更新し、使用中の図形・レイヤの参照を維持。Scaleはlayout(紙上mm)/world(モデルmm)/device(画素)。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("styles.lineWidth",
new LineWidthParameters("0.5mm", 0.5, MakeCurrent: true), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
width | 必須 | number |
makeCurrent | 省略可 | boolean |
scale | 省略可 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"width": {
"type": "number"
},
"makeCurrent": {
"type": "boolean"
},
"scale": {
"type": "string"
}
},
"required": [
"name",
"width"
]
}02 作画・注記
annotation.dimension — 点列・角度・半径・直径・座標・引出し寸法を作成 immediate
入力型: DimensionParameters
Kind: linear/coordinate/angle/radius/diameter/leader/baseline。点列による寸法。図形との新しい関連付けは未公開。
| JSON引数 | 必須 | 型 |
|---|---|---|
kind | 必須 | string |
points | 必須 | array of object |
textPosition | 必須 | object |
normal | 必須 | object |
direction | 必須 | object |
radius | 省略可 | number |
style | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"points": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"textPosition": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"direction": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"radius": {
"type": "number"
},
"style": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"points",
"textPosition",
"normal",
"direction"
]
}annotation.hatch — 閉輪郭から現在/指定スタイルのハッチを作成 worker
入力型: HatchParameters
単一の閉じた平面輪郭。Style未指定は現在のハッチスタイル。複数境界・島の直接指定は未公開。
| JSON引数 | 必須 | 型 |
|---|---|---|
profileId | 必須 | string |
style | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"profileId": {
"type": "string"
},
"style": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"profileId"
]
}fill.create — 閉輪郭の塗りつぶし・2色グラデーションを一括作成 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
fills | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"fills": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"boundary": {
"type": "object",
"additionalProperties": false,
"properties": {
"line": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"end": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"start",
"end"
]
},
{
"type": "null"
}
]
},
"circle": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"radius": {
"type": "number"
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"center",
"radius",
"normal"
]
},
{
"type": "null"
}
]
},
"arc": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"start",
"normal",
"sweepDegrees"
]
},
{
"type": "null"
}
]
},
"polyline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"vertices": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"closed": {
"type": "boolean"
}
},
"required": [
"vertices"
]
},
{
"type": "null"
}
]
},
"ellipse": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"majorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"minorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"startDegrees": {
"type": "number"
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"majorAxis",
"minorAxis"
]
},
{
"type": "null"
}
]
},
"spline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"throughPoints": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"degree": {
"type": "integer"
},
"closed": {
"type": "boolean"
}
},
"required": [
"throughPoints"
]
},
{
"type": "null"
}
]
},
"text": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"content": {
"type": "string"
},
"location": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"xDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"yDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"height": {
"type": "number"
},
"font": {
"type": "string"
}
},
"required": [
"content",
"location",
"xDirection",
"yDirection",
"height"
]
},
{
"type": "null"
}
]
},
"point": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
}
},
"required": []
},
"appearance": {
"type": "object",
"additionalProperties": false,
"properties": {
"color": {
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"rgb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"mode"
]
},
"pattern": {
"type": "string"
},
"color2": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"rgb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"mode"
]
},
{
"type": "null"
}
]
},
"angleDegrees": {
"type": "number"
},
"transparency": {
"type": "integer"
}
},
"required": [
"color"
]
},
"layer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"boundary",
"appearance"
]
}
}
},
"required": [
"fills"
]
}geometry.clothoid — ネイティブのクロソイドを作成・更新 immediate
入力型: ClothoidParameters
ネイティブのクロソイド。A・弧長はmm。EntityId指定の編集は図形ID・属性を保持。geometryクエリで定義を取得可能。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("geometry.clothoid",
new ClothoidParameters(new(0, 0, 0), new(1, 0, 0), new(0, 0, 1),
Parameter: 100, StartLength: 0, EndLength: 100), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);
// 既存クロソイドの編集は EntityId を指定。同じ図形ID・属性を維持します。| JSON引数 | 必須 | 型 |
|---|---|---|
first | 必須 | object |
direction | 必須 | object |
normal | 必須 | object |
parameter | 必須 | number |
startLength | 必須 | number |
endLength | 必須 | number |
clockwise | 省略可 | boolean |
chordDirection | 省略可 | boolean |
entityId | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"first": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"direction": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"parameter": {
"type": "number"
},
"startLength": {
"type": "number"
},
"endLength": {
"type": "number"
},
"clockwise": {
"type": "boolean"
},
"chordDirection": {
"type": "boolean"
},
"entityId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"first",
"direction",
"normal",
"parameter",
"startLength",
"endLength"
]
}geometry.clothoid.basic — 対称クロソイド・円弧・クロソイドの基本型を作成 immediate
入口・交点IP・出口の2接線方向とA・円弧Rから基本型を生成。成立しないA/R/交角は失敗。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("geometry.clothoid.basic",
new ClothoidBasicParameters(new(-100, 0, 0), new(0, 0, 0), new(0, 100, 0),
new(0, 0, 1), Parameter: 20, Radius: 30), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);| JSON引数 | 必須 | 型 |
|---|---|---|
entry | 必須 | object |
intersection | 必須 | object |
exit | 必須 | object |
normal | 必須 | object |
parameter | 必須 | number |
radius | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entry": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"intersection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"exit": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"parameter": {
"type": "number"
},
"radius": {
"type": "number"
}
},
"required": [
"entry",
"intersection",
"exit",
"normal",
"parameter",
"radius"
]
}geometry.clothoid.stations — クロソイドの横断線/接線を作成 immediate
入力型: ClothoidStationParameters
Interval指定は等間隔の横断線(最大2000)。省略は1本。Tangent=trueは1本の接線。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var selection = await cad.GetSelectionAsync(cancellationToken: ct);
string[] ids = selection.Entities.Select(e => e.Id).ToArray();
// ID は今開いている図面から取得します。保存・再起動後は取り直してください。
var request = doc.Operation("geometry.clothoid.stations",
new ClothoidStationParameters(ids[0], Start: 0, Left: 3, Right: 3,
Normal: new(0, 0, 1), Interval: 10), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
start | 必須 | number |
left | 必須 | number |
right | 必須 | number |
normal | 必須 | object |
interval | 省略可 | number / null |
tangent | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"start": {
"type": "number"
},
"left": {
"type": "number"
},
"right": {
"type": "number"
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"interval": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"tangent": {
"type": "boolean"
}
},
"required": [
"entityId",
"start",
"left",
"right",
"normal"
]
}geometry.create — 点・線・円・円弧・ポリライン・楕円・スプライン・文字の作成 immediate
GeometryDefinitionは1種類だけ指定。色・レイヤーは現在値。
| JSON引数 | 必須 | 型 |
|---|---|---|
objects | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"objects": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"line": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"end": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"start",
"end"
]
},
{
"type": "null"
}
]
},
"circle": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"radius": {
"type": "number"
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"center",
"radius",
"normal"
]
},
{
"type": "null"
}
]
},
"arc": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"start",
"normal",
"sweepDegrees"
]
},
{
"type": "null"
}
]
},
"polyline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"vertices": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"closed": {
"type": "boolean"
}
},
"required": [
"vertices"
]
},
{
"type": "null"
}
]
},
"ellipse": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"majorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"minorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"startDegrees": {
"type": "number"
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"majorAxis",
"minorAxis"
]
},
{
"type": "null"
}
]
},
"spline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"throughPoints": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"degree": {
"type": "integer"
},
"closed": {
"type": "boolean"
}
},
"required": [
"throughPoints"
]
},
{
"type": "null"
}
]
},
"text": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"content": {
"type": "string"
},
"location": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"xDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"yDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"height": {
"type": "number"
},
"font": {
"type": "string"
}
},
"required": [
"content",
"location",
"xDirection",
"yDirection",
"height"
]
},
{
"type": "null"
}
]
},
"point": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
}
},
"required": []
}
}
},
"required": [
"objects"
]
}image.import — Embed a raster image on a WCS plane immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
filePath | 必須 | string |
location | 必須 | object |
widthAxis | 必須 | object |
heightAxis | 必須 | object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"filePath": {
"type": "string"
},
"location": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"widthAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"heightAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"filePath",
"location",
"widthAxis",
"heightAxis"
]
}03 編集・複写・ブロック
block.attributes — 挿入ブロックの属性値を変更 immediate
入力型: BlockAttributesParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
values | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
]
}
}
},
"required": [
"entityId",
"values"
]
}block.create — 選択図形から名前付きブロックを作成 immediate
定義名は一意。元の選択図形をブロック参照へ置換。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
name | 必須 | string |
basePoint | 必須 | object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string"
},
"basePoint": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"entityIds",
"name",
"basePoint"
]
}block.dynamic — 既存ダイナミックブロックのパラメータを変更 worker
既存の定義にあるKeyだけ変更。新しいパラメータ・アクション定義の作成は対話エディター。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
key | 必須 | string |
value | 必須 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"entityId",
"key",
"value"
]
}block.insert — 名前付きブロックを挿入 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
position | 必須 | object |
scale | 省略可 | object / null |
rotationDegrees | 省略可 | number |
normal | 省略可 | object / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"position": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"scale": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
},
"rotationDegrees": {
"type": "number"
},
"normal": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
}
},
"required": [
"name",
"position"
]
}curve.join — 接続した曲線列を1本のパスへ結合 worker
入力型: CurveJoinParameters
全入力が1本の接続パスとなる必要があります。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
tolerance | 省略可 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"tolerance": {
"type": "number"
}
},
"required": [
"entityIds"
]
}curve.offset — 平面曲線の等距離線 worker
指定Normalを持つ平面上の曲線のみ。元の曲線は残ります。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
planeNormal | 必須 | object |
distance | 必須 | number |
tolerance | 省略可 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"planeNormal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"distance": {
"type": "number"
},
"tolerance": {
"type": "number"
}
},
"required": [
"entityId",
"planeNormal",
"distance"
]
}curve.split — 正規化パラメータで曲線を分割 worker
入力型: CurveSplitParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
parameter | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"parameter": {
"type": "number"
}
},
"required": [
"entityId",
"parameter"
]
}curve.trim — 曲線の始点・終点パラメータでトリム immediate
入力型: TrimCurveParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
startParameter | 必須 | number |
endParameter | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"startParameter": {
"type": "number"
},
"endParameter": {
"type": "number"
}
},
"required": [
"entityId",
"startParameter",
"endParameter"
]
}entities.array.circular — 軸まわりの等角度複写 immediate
Countは作る複写の数。1×StepDegreesから配置。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
center | 必須 | object |
axis | 必須 | object |
stepDegrees | 必須 | number |
count | 必須 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"axis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"stepDegrees": {
"type": "number"
},
"count": {
"type": "integer"
}
},
"required": [
"entityIds",
"center",
"axis",
"stepDegrees",
"count"
]
}entities.array.linear — 等間隔の複写 immediate
Countは作る複写の数。通常は1×Stepから。IncludeOriginalCopy=trueでは0×Stepから。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
step | 必須 | object |
count | 必須 | integer |
includeOriginalCopy | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"step": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"count": {
"type": "integer"
},
"includeOriginalCopy": {
"type": "boolean"
}
},
"required": [
"entityIds",
"step",
"count"
]
}entities.explode — パス・ブロック・シェル・ソリッドを1階層分解 worker
入力型: ExplodeParameters
1階層の分解。入力は結果へ置換。ブロック属性や板金情報を保持する編集の代わりには使えません。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"entityIds"
]
}entities.mirror — 平面を指定した鏡像 immediate
入力型: MirrorParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
planeOrigin | 必須 | object |
planeNormal | 必須 | object |
copy | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"planeOrigin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"planeNormal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"copy": {
"type": "boolean"
}
},
"required": [
"entityIds",
"planeOrigin",
"planeNormal"
]
}entities.rotate — 任意軸で回転・回転複写 immediate
入力型: RotateParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
center | 必須 | object |
axis | 必須 | object |
angleDegrees | 必須 | number |
copy | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"axis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"angleDegrees": {
"type": "number"
},
"copy": {
"type": "boolean"
}
},
"required": [
"entityIds",
"center",
"axis",
"angleDegrees"
]
}entities.scale — 基点を指定した等倍率の拡縮 immediate
入力型: ScaleParameters
正の等倍率のみ。認識済み板金は対象外。板金の寸法APIを利用。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
center | 必須 | object |
factor | 必須 | number |
copy | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"factor": {
"type": "number"
},
"copy": {
"type": "boolean"
}
},
"required": [
"entityIds",
"center",
"factor"
]
}fill.set — 塗りつぶしの色・グラデーション・角度・透明度を変更 immediate
入力型: SetFillParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
appearance | 必須 | object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"appearance": {
"type": "object",
"additionalProperties": false,
"properties": {
"color": {
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"rgb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"mode"
]
},
"pattern": {
"type": "string"
},
"color2": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"rgb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"mode"
]
},
{
"type": "null"
}
]
},
"angleDegrees": {
"type": "number"
},
"transparency": {
"type": "integer"
}
},
"required": [
"color"
]
}
},
"required": [
"entityIds",
"appearance"
]
}geometry.update — 図形の定義を変更(IDと属性を維持) immediate
同じネイティブ型の定義へ更新し、図形IDと属性を維持。任意の内部プロパティを書き換える機能ではありません。
| JSON引数 | 必須 | 型 |
|---|---|---|
updates | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"updates": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"geometry": {
"type": "object",
"additionalProperties": false,
"properties": {
"line": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"end": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"start",
"end"
]
},
{
"type": "null"
}
]
},
"circle": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"radius": {
"type": "number"
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"center",
"radius",
"normal"
]
},
{
"type": "null"
}
]
},
"arc": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"start",
"normal",
"sweepDegrees"
]
},
{
"type": "null"
}
]
},
"polyline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"vertices": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"closed": {
"type": "boolean"
}
},
"required": [
"vertices"
]
},
{
"type": "null"
}
]
},
"ellipse": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"majorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"minorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"startDegrees": {
"type": "number"
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"majorAxis",
"minorAxis"
]
},
{
"type": "null"
}
]
},
"spline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"throughPoints": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"degree": {
"type": "integer"
},
"closed": {
"type": "boolean"
}
},
"required": [
"throughPoints"
]
},
{
"type": "null"
}
]
},
"text": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"content": {
"type": "string"
},
"location": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"xDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"yDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"height": {
"type": "number"
},
"font": {
"type": "string"
}
},
"required": [
"content",
"location",
"xDirection",
"yDirection",
"height"
]
},
{
"type": "null"
}
]
},
"point": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
}
},
"required": []
}
},
"required": [
"entityId",
"geometry"
]
}
}
},
"required": [
"updates"
]
}text.update — 文字内容だけを変更(書式・位置・IDを維持) immediate
入力型: UpdateTextParameters
通常のトップレベルTextを1~100個、文字内容だけ更新。1~32768文字。書式・配置・位置・IDを保持。ブロック属性定義は対象外。全件を検証して1回のUndoで反映。
| JSON引数 | 必須 | 型 |
|---|---|---|
updates | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"updates": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"entityId",
"content"
]
}
}
},
"required": [
"updates"
]
}04 3D・面編集
face.label — 面に文字・画像ラベルを貼付け/置換/削除。平面・曲面対応、穴と境界でクリップ。JDCへ埋め込み。形状・体積不変。ラベル一覧はcad_query kind=surfaceLabels。 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
face | 必須 | object |
center | 必須 | object |
width | 省略可 | number |
height | 省略可 | number |
rotationDegrees | 省略可 | number |
text | 省略可 | string / null |
imagePath | 省略可 | string / null |
fontName | 省略可 | string |
color | 省略可 | string |
mode | 省略可 | string |
labelId | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"face": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"width": {
"type": "number"
},
"height": {
"type": "number"
},
"rotationDegrees": {
"type": "number"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"imagePath": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"fontName": {
"type": "string"
},
"color": {
"type": "string"
},
"mode": {
"type": "string"
},
"labelId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"face",
"center"
]
}face.move — 指定面を移動 worker
入力型: FaceMoveParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
displacement | 必須 | object |
moveConnected | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"displacement": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"moveConnected": {
"type": "boolean"
}
},
"required": [
"entityId",
"faces",
"displacement"
]
}face.offset — 指定面のオフセット(通常コマンドと同じ経路) worker
入力型: FaceOffsetParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
distance | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"distance": {
"type": "number"
}
},
"required": [
"entityId",
"faces",
"distance"
]
}face.radius — 円柱等の半径を変更 worker
入力型: FaceRadiusParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
radius | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"radius": {
"type": "number"
}
},
"required": [
"entityId",
"faces",
"radius"
]
}face.remove — 面削除・周辺面による修復 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
}
},
"required": [
"entityId",
"faces"
]
}face.rotate — 指定面を回転 worker
入力型: FaceRotateParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
origin | 必須 | object |
axis | 必須 | object |
angleDegrees | 必須 | number |
moveConnected | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"origin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"axis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"angleDegrees": {
"type": "number"
},
"moveConnected": {
"type": "boolean"
}
},
"required": [
"entityId",
"faces",
"origin",
"axis",
"angleDegrees"
]
}geometry.extrude — 閉輪郭/面の押出し、曲線の押出し面 worker
入力型: ExtrudeParameters
Solid=trueは閉じた平面輪郭/面。falseは曲線から側面を作成。DeleteSources=falseが既定。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
direction | 必須 | object |
solid | 省略可 | boolean |
deleteSources | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"direction": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"solid": {
"type": "boolean"
},
"deleteSources": {
"type": "boolean"
}
},
"required": [
"entityIds",
"direction"
]
}geometry.helix — 軸・半径・高さ・巻数でらせんパスを作成 worker
入力型: HelixParameters
らせんパス。axisは向きのみ。詳細はhelix-interference.ja.html。
| JSON引数 | 必須 | 型 |
|---|---|---|
center | 必須 | object |
axis | 必須 | object |
baseRadius | 必須 | number |
topRadius | 必須 | number |
height | 必須 | number |
turns | 必須 | number |
segmentsPerTurn | 省略可 | integer |
clockwise | 省略可 | boolean |
startDirection | 省略可 | object / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"axis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"baseRadius": {
"type": "number"
},
"topRadius": {
"type": "number"
},
"height": {
"type": "number"
},
"turns": {
"type": "number"
},
"segmentsPerTurn": {
"type": "integer"
},
"clockwise": {
"type": "boolean"
},
"startDirection": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
}
},
"required": [
"center",
"axis",
"baseRadius",
"topRadius",
"height",
"turns"
]
}geometry.loft — 断面列と任意ガイドによるロフト worker
入力型: LoftParameters
断面2~64。入力順がロフト順。GuideIdは任意。
| JSON引数 | 必須 | 型 |
|---|---|---|
profileIds | 必須 | array of string |
solid | 省略可 | boolean |
guideId | 省略可 | string / null |
deleteSources | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"profileIds": {
"type": "array",
"items": {
"type": "string"
}
},
"solid": {
"type": "boolean"
},
"guideId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"deleteSources": {
"type": "boolean"
}
},
"required": [
"profileIds"
]
}geometry.revolve — 断面を軸のまわりに回転 worker
入力型: RevolveParameters
角度は±360度、0不可。軸はOriginとAxis。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
origin | 必須 | object |
axis | 必須 | object |
angleDegrees | 省略可 | number |
deleteSource | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"origin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"axis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"angleDegrees": {
"type": "number"
},
"deleteSource": {
"type": "boolean"
}
},
"required": [
"entityId",
"origin",
"axis"
]
}geometry.screw — 閉断面をピッチ・巻数指定でらせん回転しソリッドを作成 worker
入力型: ScrewParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
profileId | 必須 | string |
origin | 必須 | object |
axis | 必須 | object |
pitch | 必須 | number |
turns | 必須 | number |
rightHanded | 省略可 | boolean |
deleteSource | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"profileId": {
"type": "string"
},
"origin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"axis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"pitch": {
"type": "number"
},
"turns": {
"type": "number"
},
"rightHanded": {
"type": "boolean"
},
"deleteSource": {
"type": "boolean"
}
},
"required": [
"profileId",
"origin",
"axis",
"pitch",
"turns"
]
}geometry.sweep — 断面とパスによるスイープ worker
入力型: SweepParameters
断面とパスの向き・形状は既存エンジンの条件に従います。
| JSON引数 | 必須 | 型 |
|---|---|---|
profileId | 必須 | string |
pathId | 必須 | string |
deleteSources | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"profileId": {
"type": "string"
},
"pathId": {
"type": "string"
},
"deleteSources": {
"type": "boolean"
}
},
"required": [
"profileId",
"pathId"
]
}solid.boolean — ソリッドの和・差・積 worker
入力型: BooleanParameters
Kindはunion/subtract/intersect。subtractの先頭が母材。入力ソリッドは結果と置換。空の結果は反映せず失敗。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
kind | 必須 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"kind": {
"type": "string"
}
},
"required": [
"entityIds",
"kind"
]
}solid.chamfer — 基準面とエッジを指定した面取り worker
入力型: ChamferParameters
ReferenceFace側と反対側の距離。等辺面取りはDistance1=Distance2。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
referenceFace | 必須 | object |
edges | 必須 | array of object |
distance1 | 必須 | number |
distance2 | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"referenceFace": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"edges": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"distance1": {
"type": "number"
},
"distance2": {
"type": "number"
}
},
"required": [
"entityId",
"referenceFace",
"edges",
"distance1",
"distance2"
]
}solid.fillet — 指定エッジのフィレット worker
入力型: FilletParameters
単一シェルのソリッド。辺参照を指定。半径と形状により失敗します。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
edges | 必須 | array of object |
radius | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"edges": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"radius": {
"type": "number"
}
},
"required": [
"entityId",
"edges",
"radius"
]
}solid.fillet.remove — 指定フィレット面を除去して支持面を復元 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
}
},
"required": [
"entityId",
"faces"
]
}solid.fillet.resize — 指定フィレット面と連続する丸みの半径を変更 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
radius | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"radius": {
"type": "number"
}
},
"required": [
"entityId",
"faces",
"radius"
]
}solid.primitive — 箱・円柱・円すい・球・トーラス worker
入力型: PrimitiveParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
kind | 必須 | string |
origin | 必須 | object |
size | 省略可 | object / null |
axis | 省略可 | object / null |
radius | 省略可 | number |
secondRadius | 省略可 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"origin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"size": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
},
"axis": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
},
"radius": {
"type": "number"
},
"secondRadius": {
"type": "number"
}
},
"required": [
"kind",
"origin"
]
}solid.shell — 開口面と厚さを指定してシェル化 worker
入力型: ShellParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
openFaces | 必須 | array of object |
thickness | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"openFaces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"thickness": {
"type": "number"
}
},
"required": [
"entityId",
"openFaces",
"thickness"
]
}surface.create — 閉じた平面輪郭から面を作成 worker
入力型: CreateFaceParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
deleteSource | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"deleteSource": {
"type": "boolean"
}
},
"required": [
"entityId"
]
}surface.sew — 面とシェルを縫合 worker
入力型: SewParameters
入力の面/シェルを縫合結果へ置換。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"entityIds"
]
}surface.trim — 単独サーフェスを別面で分割 worker
対象は単独のFace。両側の分割結果を返します。ソリッド内の面の部分トリムはこのAPIの対象外。
| JSON引数 | 必須 | 型 |
|---|---|---|
target | 必須 | object |
cutter | 必須 | object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"target": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"cutter": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"required": [
"target",
"cutter"
]
}05 板金
sheet.bend — 線を指定して曲げる worker
入力型: SheetBendParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
lineId | 必須 | string |
fixedFace | 必須 | object |
rules | 必須 | object |
angleDegrees | 省略可 | number |
positionReference | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"lineId": {
"type": "string"
},
"fixedFace": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"angleDegrees": {
"type": "number"
},
"positionReference": {
"type": "integer"
}
},
"required": [
"entityId",
"lineId",
"fixedFace",
"rules"
]
}sheet.contour — 連続フランジを作成 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
edge | 必須 | object |
rules | 必須 | object |
steps | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"edge": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"steps": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"length": {
"type": "number"
},
"angleDegrees": {
"type": "number"
},
"radius": {
"type": "number"
}
},
"required": [
"length",
"angleDegrees",
"radius"
]
}
}
},
"required": [
"entityId",
"edge",
"rules",
"steps"
]
}sheet.corner — コーナーを処理 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
faces | 必須 | array of object |
gap | 必須 | number |
kind | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"faces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"gap": {
"type": "number"
},
"kind": {
"type": "integer"
}
},
"required": [
"entityId",
"faces",
"gap"
]
}sheet.editBend — 曲げ角・半径・長さを編集 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
bendFace | 必須 | object |
angleDegrees | 必須 | number |
radius | 必須 | number |
length | 必須 | number |
lengthReference | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"bendFace": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"angleDegrees": {
"type": "number"
},
"radius": {
"type": "number"
},
"length": {
"type": "number"
},
"lengthReference": {
"type": "integer"
}
},
"required": [
"entityId",
"bendFace",
"angleDegrees",
"radius",
"length"
]
}sheet.editForm — 成形の編集・削除 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
formId | 必須 | string |
dimensions | 必須 | object |
delete | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"formId": {
"type": "string"
},
"dimensions": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "integer"
},
"diameter": {
"type": "number"
},
"height": {
"type": "number"
},
"rootRadius": {
"type": "number"
},
"crownRadius": {
"type": "number"
},
"span": {
"type": "number"
},
"pilotDiameter": {
"type": "number"
},
"suppressed": {
"type": "boolean"
},
"cornerRadius": {
"type": "number"
},
"bridgeHoleDiameter": {
"type": "number"
},
"wallAngleDegrees": {
"type": "number"
}
},
"required": [
"kind"
]
},
"delete": {
"type": "boolean"
}
},
"required": [
"entityId",
"formId",
"dimensions"
]
}sheet.flange — エッジフランジを作成 worker
エッジ全体、またはstartDistance/endDistanceで指定する1辺の部分区間が対象。テーパーの個別指定は画面版を利用。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
edges | 必須 | array of object |
rules | 必須 | object |
length | 必須 | number |
angleDegrees | 省略可 | number |
gap | 省略可 | number |
autoCorner | 省略可 | boolean |
positionReference | 省略可 | integer |
lengthReference | 省略可 | integer |
startDistance | 省略可 | number / null |
endDistance | 省略可 | number / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"edges": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"length": {
"type": "number"
},
"angleDegrees": {
"type": "number"
},
"gap": {
"type": "number"
},
"autoCorner": {
"type": "boolean"
},
"positionReference": {
"type": "integer"
},
"lengthReference": {
"type": "integer"
},
"startDistance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"endDistance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
}
},
"required": [
"entityId",
"edges",
"rules",
"length"
]
}sheet.flatPattern — 輪郭・曲げ線・注記から展開図を作成 worker
入力型: SheetFlatPatternParameters
展開図の図形をモデルへ追加。ファイルへのDXF等の書出しではありません。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
placement | 必須 | object |
bendLines | 省略可 | boolean |
annotations | 省略可 | boolean |
bendTable | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"placement": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"bendLines": {
"type": "boolean"
},
"annotations": {
"type": "boolean"
},
"bendTable": {
"type": "boolean"
}
},
"required": [
"entityId",
"placement"
]
}sheet.form — バーリング・ダボ・エンボス・ビード・ルーバー・絞り・ブリッジを作成 worker
入力型: SheetFormParameters
成形の寸法はSheetFormDimensions。ルーバー/ブリッジのゼロ幅切込みは展開図のSM_CUTへ。製造時の伸び代は計算しません。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
face | 必須 | object |
center | 必須 | object |
dimensions | 必須 | object |
rotationDegrees | 省略可 | number |
reverse | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"face": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"dimensions": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "integer"
},
"diameter": {
"type": "number"
},
"height": {
"type": "number"
},
"rootRadius": {
"type": "number"
},
"crownRadius": {
"type": "number"
},
"span": {
"type": "number"
},
"pilotDiameter": {
"type": "number"
},
"suppressed": {
"type": "boolean"
},
"cornerRadius": {
"type": "number"
},
"bridgeHoleDiameter": {
"type": "number"
},
"wallAngleDegrees": {
"type": "number"
}
},
"required": [
"kind"
]
},
"rotationDegrees": {
"type": "number"
},
"reverse": {
"type": "boolean"
}
},
"required": [
"entityId",
"face",
"center",
"dimensions"
]
}sheet.hem — 開きヘムを作成 worker
入力型: SheetHemParameters
開きヘム。閉じた潰しヘムではありません。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
edges | 必須 | array of object |
rules | 必須 | object |
length | 必須 | number |
gap | 必須 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"edges": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"length": {
"type": "number"
},
"gap": {
"type": "number"
}
},
"required": [
"entityId",
"edges",
"rules",
"length",
"gap"
]
}sheet.jog — 段曲げを作成 worker
入力型: SheetJogParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
edge | 必須 | object |
rules | 必須 | object |
height | 必須 | number |
length | 必須 | number |
angleDegrees | 省略可 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"edge": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"height": {
"type": "number"
},
"length": {
"type": "number"
},
"angleDegrees": {
"type": "number"
}
},
"required": [
"entityId",
"edge",
"rules",
"height",
"length"
]
}sheet.loft — ロール・ロフト板金の作成/寸法・角R編集 worker
入力型: SheetLoftParameters
EntityId未指定で新規、指定すると既存ロフト寸法を編集。加工を保持できる条件は本体と同じ。
| JSON引数 | 必須 | 型 |
|---|---|---|
rules | 必須 | object |
dimensions | 必須 | object |
entityId | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"dimensions": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "integer"
},
"formingMode": {
"type": "integer"
},
"bottomRadius": {
"type": "number"
},
"topRadius": {
"type": "number"
},
"height": {
"type": "number"
},
"bottomWidth": {
"type": "number"
},
"bottomDepth": {
"type": "number"
},
"topWidth": {
"type": "number"
},
"topDepth": {
"type": "number"
},
"cornerRadius": {
"type": "number"
},
"topCornerRadius": {
"type": "number"
},
"offsetX": {
"type": "number"
},
"offsetY": {
"type": "number"
},
"seamGap": {
"type": "number"
},
"segments": {
"type": "integer"
},
"seamMode": {
"type": "integer"
},
"seamAngle": {
"type": "number"
},
"angle": {
"type": "number"
},
"origin": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
}
},
"required": []
},
"entityId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"rules",
"dimensions"
]
}sheet.manageBend — 曲げの抑制・復元・削除・親変更 worker
入力型: SheetManageBendParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
bendIndex | 必須 | integer |
operation | 必須 | integer |
parentIndex | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"bendIndex": {
"type": "integer"
},
"operation": {
"type": "integer"
},
"parentIndex": {
"type": "integer"
}
},
"required": [
"entityId",
"bendIndex",
"operation"
]
}sheet.plate — 板金基本板を作成 worker
入力型: SheetPlateParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
profileId | 必須 | string |
rules | 必須 | object |
thicknessSide | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"profileId": {
"type": "string"
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"thicknessSide": {
"type": "integer"
}
},
"required": [
"profileId",
"rules"
]
}sheet.recognize — 既存ソリッドを板金認識 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
baseFace | 必須 | object |
rules | 必須 | object |
detectThickness | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"baseFace": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
},
"detectThickness": {
"type": "boolean"
}
},
"required": [
"entityId",
"baseFace",
"rules"
]
}sheet.refold — 加工を保持して再曲げ worker
入力型: SheetBodyParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
}
},
"required": [
"entityId"
]
}sheet.relief — 曲げ逃げを作成/除去 worker
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
edges | 必須 | array of object |
width | 必須 | number |
depth | 必須 | number |
round | 省略可 | boolean |
remove | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"edges": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"width": {
"type": "number"
},
"depth": {
"type": "number"
},
"round": {
"type": "boolean"
},
"remove": {
"type": "boolean"
}
},
"required": [
"entityId",
"edges",
"width",
"depth"
]
}sheet.rip — 指定エッジに切れ目を作成 worker
入力型: SheetRipParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
edges | 必須 | array of object |
gap | 必須 | number |
side | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"edges": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"revision": {
"type": "integer"
},
"kind": {
"type": "string"
},
"index": {
"type": "integer"
}
},
"required": [
"entityId",
"revision",
"kind",
"index"
]
}
},
"gap": {
"type": "number"
},
"side": {
"type": "integer"
}
},
"required": [
"entityId",
"edges",
"gap"
]
}sheet.rules — 既存板金の板厚・曲げ設定を変更 worker
入力型: SheetRulesParameters
厚さ・半径・K係数・逃げ寸法。展開補正表の全定義は画面版を利用。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
rules | 必須 | object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
},
"rules": {
"type": "object",
"additionalProperties": false,
"properties": {
"thickness": {
"type": "number"
},
"radius": {
"type": "number"
},
"kFactor": {
"type": "number"
},
"reliefType": {
"type": "integer"
},
"reliefWidth": {
"type": "number"
},
"reliefDepth": {
"type": "number"
}
},
"required": []
}
},
"required": [
"entityId",
"rules"
]
}sheet.unfold — 板金を展開 worker
入力型: SheetBodyParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
entityId | 必須 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityId": {
"type": "string"
}
},
"required": [
"entityId"
]
}06 計測・解析
analysis.assembly.contacts — 複数ソリッド間の接合面を検出 worker-data
入力型: AssemblyContactsParameters
閉じた単一シェルのソリッド2~100個。体積の重なりは不可。接合面は完全接合または非接合で、摩擦・接触離脱を伴う非線形接触ではありません。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var selection = await cad.GetSelectionAsync(cancellationToken: ct);
string[] ids = selection.Entities.Select(e => e.Id).ToArray();
// ID は今開いている図面から取得します。保存・再起動後は取り直してください。
var request = doc.Operation("analysis.assembly.contacts",
new AssemblyContactsParameters(ids), selectResult: false);
var job = await cad.StartOperationAsync(new(request, 180), ct);
while (job.State == "running")
{
await Task.Delay(100, ct);
job = await cad.GetJobAsync(job.Id, ct);
}
if (job.State != "completed") throw new InvalidOperationException(job.Message);
var result = await cad.GetJobDataAsync(new(job.Id, "summary"), ct);
// 配列はセクション名と Offset/Limit を指定して全ページを取得します。
// contacts セクションに接合面の Group、Body1/Body2、面積、輪郭を返します。| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
tolerance | 省略可 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"tolerance": {
"type": "number"
}
},
"required": [
"entityIds"
]
}analysis.assembly.mesh — 部品別領域・接合設定を保持した3Dメッシュを生成 worker-data
節点・要素のほかelementBodies/bodyNames/contacts/bodySurfacesを全ページ取得。部品番号は入力IDの順で1始まり。接合設定を変えたらメッシュを作り直します。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var selection = await cad.GetSelectionAsync(cancellationToken: ct);
string[] ids = selection.Entities.Select(e => e.Id).ToArray();
// ID は今開いている図面から取得します。保存・再起動後は取り直してください。
var request = doc.Operation("analysis.assembly.mesh",
new AssemblyMeshParameters(ids, MeshSize: 5, ExcludedContactGroups: []), selectResult: false);
var job = await cad.StartOperationAsync(new(request, 180), ct);
while (job.State == "running")
{
await Task.Delay(100, ct);
job = await cad.GetJobAsync(job.Id, ct);
}
if (job.State != "completed") throw new InvalidOperationException(job.Message);
var result = await cad.GetJobDataAsync(new(job.Id, "summary"), ct);
// 配列はセクション名と Offset/Limit を指定して全ページを取得します。
// Body番号は ids の順に1始まり。検出時と同じ順序で渡します。
// 接合を解除する面の Group を ExcludedContactGroups に指定します。| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
meshSize | 省略可 | number |
tolerance | 省略可 | number |
excludedContactGroups | 省略可 | array / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"meshSize": {
"type": "number"
},
"tolerance": {
"type": "number"
},
"excludedContactGroups": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
}
},
"required": [
"entityIds"
]
}analysis.assembly.solve — 部品ごとの材料でアセンブリの応力/熱解析 worker-data
BodyMaterialsはBodyNamesと同じ順。弾性・定常/非定常熱解析。メッシュ接続情報を維持して入力。結果はデータ取得、解析画面のスタディ登録は未公開。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
// assemblyMesh は assembly.mesh の全ページから復元した AssemblyMeshData。
// leftNodes/rightNodes はそのメッシュの境界節点番号(int[])、0始まりです。
// BodyMaterials は BodyNames と同じ順序・件数です。
var request = doc.Operation("analysis.assembly.solve",
new AssemblySolveParameters(assemblyMesh,
[new AnalysisMaterialData("低熱伝導材", Conductivity: 10),
new AnalysisMaterialData("高熱伝導材", Conductivity: 30)],
[new AnalysisConditionData("temperature", Target: "node", NodeIds: leftNodes, X: 0),
new AnalysisConditionData("temperature", Target: "node", NodeIds: rightNodes, X: 100)],
Kind: "heat"), selectResult: false);
var job = await cad.StartOperationAsync(new(request, 180), ct);
while (job.State == "running")
{
await Task.Delay(100, ct);
job = await cad.GetJobAsync(job.Id, ct);
}
if (job.State != "completed") throw new InvalidOperationException(job.Message);
var result = await cad.GetJobDataAsync(new(job.Id, "summary"), ct);
// 配列はセクション名と Offset/Limit を指定して全ページを取得します。| JSON引数 | 必須 | 型 |
|---|---|---|
mesh | 必須 | object |
bodyMaterials | 必須 | array of object |
conditions | 必須 | array of object |
kind | 省略可 | string |
transientThermal | 省略可 | boolean |
initialTemperature | 省略可 | number |
endTime | 省略可 | number |
timeStep | 省略可 | number |
outputCount | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"mesh": {
"type": "object",
"additionalProperties": false,
"properties": {
"mesh": {
"type": "object",
"additionalProperties": false,
"properties": {
"dimension": {
"type": "integer"
},
"points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"elements": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer"
}
}
},
"boundaries": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"group": {
"type": "integer"
},
"nodes": {
"type": "array",
"items": {
"type": "integer"
}
},
"body": {
"type": "integer"
}
},
"required": [
"group",
"nodes"
]
}
},
"edgeBoundaries": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"group": {
"type": "integer"
},
"nodes": {
"type": "array",
"items": {
"type": "integer"
}
},
"body": {
"type": "integer"
}
},
"required": [
"group",
"nodes"
]
}
},
{
"type": "null"
}
]
},
"vertexNodes": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
}
},
"required": [
"dimension",
"points",
"elements",
"boundaries"
]
},
"elementBodies": {
"type": "array",
"items": {
"type": "integer"
}
},
"bodyNames": {
"type": "array",
"items": {
"type": "string"
}
},
"contacts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"group": {
"type": "integer"
},
"body1": {
"type": "integer"
},
"body2": {
"type": "integer"
},
"area": {
"type": "number"
},
"enabled": {
"type": "boolean"
},
"outline": {
"anyOf": [
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
{
"type": "null"
}
]
}
},
"required": [
"group",
"body1",
"body2",
"area"
]
}
},
"bodySurfaces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"group": {
"type": "integer"
},
"nodes": {
"type": "array",
"items": {
"type": "integer"
}
},
"body": {
"type": "integer"
}
},
"required": [
"group",
"nodes"
]
}
}
},
"required": [
"mesh",
"elementBodies",
"bodyNames",
"contacts",
"bodySurfaces"
]
},
"bodyMaterials": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"youngModulus": {
"type": "number"
},
"poissonRatio": {
"type": "number"
},
"density": {
"type": "number"
},
"conductivity": {
"type": "number"
},
"specificHeat": {
"type": "number"
},
"expansionMicro": {
"type": "number"
}
},
"required": []
}
},
"conditions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"group": {
"type": "integer"
},
"node": {
"type": "integer"
},
"target": {
"type": "string"
},
"groups": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
},
"nodeIds": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
},
"boundaryIndices": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
},
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"kind"
]
}
},
"kind": {
"type": "string"
},
"transientThermal": {
"type": "boolean"
},
"initialTemperature": {
"type": "number"
},
"endTime": {
"type": "number"
},
"timeStep": {
"type": "number"
},
"outputCount": {
"type": "integer"
}
},
"required": [
"mesh",
"bodyMaterials",
"conditions"
]
}analysis.mesh — 単一材料の2D/3Dメッシュを生成 worker-data
2Dの閉輪郭または3Dの1ソリッド。解析用ネイティブランタイムとJDesignKernelWorkerも必要。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
dimension | 必須 | integer |
meshSize | 省略可 | number |
tolerance | 省略可 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"dimension": {
"type": "integer"
},
"meshSize": {
"type": "number"
},
"tolerance": {
"type": "number"
}
},
"required": [
"entityIds",
"dimension"
]
}analysis.solve — メッシュ・材料・境界条件を指定し応力/定常・非定常熱解析 worker-data
単一材料。部品別材料はanalysis.assembly.solveを使用。結果を解析画面のスタディへ登録する機能は未公開。
| JSON引数 | 必須 | 型 |
|---|---|---|
mesh | 必須 | object |
material | 必須 | object |
conditions | 必須 | array of object |
kind | 省略可 | string |
thickness | 省略可 | number |
planeStrain | 省略可 | boolean |
transientThermal | 省略可 | boolean |
initialTemperature | 省略可 | number |
endTime | 省略可 | number |
timeStep | 省略可 | number |
outputCount | 省略可 | integer |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"mesh": {
"type": "object",
"additionalProperties": false,
"properties": {
"dimension": {
"type": "integer"
},
"points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"elements": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer"
}
}
},
"boundaries": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"group": {
"type": "integer"
},
"nodes": {
"type": "array",
"items": {
"type": "integer"
}
},
"body": {
"type": "integer"
}
},
"required": [
"group",
"nodes"
]
}
},
"edgeBoundaries": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"group": {
"type": "integer"
},
"nodes": {
"type": "array",
"items": {
"type": "integer"
}
},
"body": {
"type": "integer"
}
},
"required": [
"group",
"nodes"
]
}
},
{
"type": "null"
}
]
},
"vertexNodes": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
}
},
"required": [
"dimension",
"points",
"elements",
"boundaries"
]
},
"material": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"youngModulus": {
"type": "number"
},
"poissonRatio": {
"type": "number"
},
"density": {
"type": "number"
},
"conductivity": {
"type": "number"
},
"specificHeat": {
"type": "number"
},
"expansionMicro": {
"type": "number"
}
},
"required": []
},
"conditions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"group": {
"type": "integer"
},
"node": {
"type": "integer"
},
"target": {
"type": "string"
},
"groups": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
},
"nodeIds": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
},
"boundaryIndices": {
"anyOf": [
{
"type": "array",
"items": {
"type": "integer"
}
},
{
"type": "null"
}
]
},
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"kind"
]
}
},
"kind": {
"type": "string"
},
"thickness": {
"type": "number"
},
"planeStrain": {
"type": "boolean"
},
"transientThermal": {
"type": "boolean"
},
"initialTemperature": {
"type": "number"
},
"endTime": {
"type": "number"
},
"timeStep": {
"type": "number"
},
"outputCount": {
"type": "integer"
}
},
"required": [
"mesh",
"material",
"conditions"
]
}measure.contour — 複数曲線から閉領域を認識して周長・面積・図心・断面二次モーメントを取得 worker-data
明示した候補曲線から種となる1辺につながる閉輪郭を認識。分岐や隙間は失敗として返します。元図形を変更せず、summaryに周長・面積・図心・図心軸の断面二次モーメントと使用したIDを返します。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var selection = await cad.GetSelectionAsync(cancellationToken: ct);
string[] ids = selection.Entities.Select(e => e.Id).ToArray();
// ID は今開いている図面から取得します。保存・再起動後は取り直してください。
var request = doc.Operation("measure.contour",
new ContourMeasureParameters(ids[0], ids,
new(0, 0, 0), new(0, 0, 1), new(1, 0, 0)), selectResult: false);
var job = await cad.StartOperationAsync(new(request, 180), ct);
while (job.State == "running")
{
await Task.Delay(100, ct);
job = await cad.GetJobAsync(job.Id, ct);
}
if (job.State != "completed") throw new InvalidOperationException(job.Message);
var result = await cad.GetJobDataAsync(new(job.Id, "summary"), ct);
// 配列はセクション名と Offset/Limit を指定して全ページを取得します。| JSON引数 | 必須 | 型 |
|---|---|---|
seedId | 必須 | string |
candidateIds | 必須 | array of string |
origin | 必須 | object |
normal | 必須 | object |
xDirection | 必須 | object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"seedId": {
"type": "string"
},
"candidateIds": {
"type": "array",
"items": {
"type": "string"
}
},
"origin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"xDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"seedId",
"candidateIds",
"origin",
"normal",
"xDirection"
]
}measure.geometry — 曲線長・閉鎖・平面性・断面積・体積・重心を計算 worker-data
入力型: MeasureParameters
summary/itemsで長さ・閉鎖・平面性・断面積・体積・重心。対象外型はstatus=unsupported。慣性は断面のローカル平面軸に対する値。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
tolerance | 省略可 | number |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"tolerance": {
"type": "number"
}
},
"required": [
"entityIds"
]
}measure.highlight — 認識した閉輪郭を一時ハイライト/解除 immediate
入力型: ContourHighlightParameters
モデル空間で認識した輪郭線を一時表示。Clear=trueで解除。Undo・保存対象を増やしません。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var selection = await cad.GetSelectionAsync(cancellationToken: ct);
string[] ids = selection.Entities.Select(e => e.Id).ToArray();
// ID は今開いている図面から取得します。保存・再起動後は取り直してください。
var request = doc.Operation("measure.highlight",
new ContourHighlightParameters(new ContourMeasureParameters(ids[0], ids,
new(0, 0, 0), new(0, 0, 1), new(1, 0, 0))), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);
// 解除: 同じ操作名に new ContourHighlightParameters(Clear: true) を渡します。| JSON引数 | 必須 | 型 |
|---|---|---|
contour | 省略可 | object / null |
clear | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"contour": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"seedId": {
"type": "string"
},
"candidateIds": {
"type": "array",
"items": {
"type": "string"
}
},
"origin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"xDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"seedId",
"candidateIds",
"origin",
"normal",
"xDirection"
]
},
{
"type": "null"
}
]
},
"clear": {
"type": "boolean"
}
},
"required": []
}solid.interference — ソリッド間の干渉・接触を形状を変更せずに検査 worker-data
静止したソリッドの干渉・面接触。summary/pairsを取得。failedを干渉なしと解釈しない。
| JSON引数 | 必須 | 型 |
|---|---|---|
entityIds | 必須 | array of string |
tolerance | 省略可 | number |
pairs | 省略可 | array / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"tolerance": {
"type": "number"
},
"pairs": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"firstEntityId": {
"type": "string"
},
"secondEntityId": {
"type": "string"
}
},
"required": [
"firstEntityId",
"secondEntityId"
]
}
},
{
"type": "null"
}
]
}
},
"required": [
"entityIds"
]
}07 レイアウト・表示
animation.control — アニメーションの再生・一時停止・再開・停止 immediate
入力型: AnimationControlParameters
play/pause/resume/stop。再生姿勢は表示用で元図形を変形しません。ビューの設定を変更する場合は先にstop。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("animation.control",
new AnimationControlParameters("動作ビュー", "play", Schedule: "動作"), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);
// Action="pause" / "resume" / "stop"。設定変更前に停止してください。| JSON引数 | 必須 | 型 |
|---|---|---|
view | 必須 | string |
action | 必須 | string |
schedule | 省略可 | string / null |
start | 省略可 | number |
end | 省略可 | number / null |
speed | 省略可 | number / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"view": {
"type": "string"
},
"action": {
"type": "string"
},
"schedule": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"start": {
"type": "number"
},
"end": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"speed": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
}
},
"required": [
"view",
"action"
]
}animation.drive — 回転・曲線・2曲線ドライブの作成・更新・削除 immediate
回転は度、曲線は曲線始点からのmm。dualCurveは2本の曲線ドライブに従います。循環依存は不可。削除前に参照するドライブ/スケジュールを解除。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var selection = await cad.GetSelectionAsync(cancellationToken: ct);
string[] ids = selection.Entities.Select(e => e.Id).ToArray();
// ID は今開いている図面から取得します。保存・再起動後は取り直してください。
var request = doc.Operation("animation.drive",
new AnimationDriveParameters("回転", "axis", ids,
AxisOrigin: new(0, 0, 0), AxisDirection: new(0, 0, 1)), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);
// 曲線ドライブは Kind="curve", CurveId=曲線のID。
// 2曲線は Kind="dualCurve", FirstDrive/SecondDrive=曲線ドライブ名。| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
kind | 必須 | string |
entityIds | 必須 | array of string |
axisOrigin | 省略可 | object / null |
axisDirection | 省略可 | object / null |
curveId | 省略可 | string / null |
firstDrive | 省略可 | string / null |
secondDrive | 省略可 | string / null |
dependsOn | 省略可 | string / null |
position | 省略可 | number |
nullPosition | 省略可 | number |
tangential | 省略可 | boolean |
stretch | 省略可 | boolean |
mode | 省略可 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"kind": {
"type": "string"
},
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"axisOrigin": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
},
"axisDirection": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
},
"curveId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"firstDrive": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"secondDrive": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"dependsOn": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"position": {
"type": "number"
},
"nullPosition": {
"type": "number"
},
"tangential": {
"type": "boolean"
},
"stretch": {
"type": "boolean"
},
"mode": {
"type": "string"
}
},
"required": [
"name",
"kind",
"entityIds"
]
}animation.schedule — アニメーションの動作時間・位置を設定/削除 immediate
入力型: AnimationScheduleParameters
秒と位置のキーをドライブごとに指定。各トラック2個以上の異なる時刻。曲線端連動はToCurveEnd=true。設定変更前に停止。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("animation.schedule",
new AnimationScheduleParameters("動作",
[new AnimationTrack("回転", [new(0, 0), new(5, 90), new(10, 0)])]), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
tracks | 必須 | array of object |
mode | 省略可 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"tracks": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"drive": {
"type": "string"
},
"keys": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"time": {
"type": "number"
},
"position": {
"type": "number"
},
"toCurveEnd": {
"type": "boolean"
}
},
"required": [
"time",
"position"
]
}
}
},
"required": [
"drive",
"keys"
]
}
},
"mode": {
"type": "string"
}
},
"required": [
"name",
"tracks"
]
}animation.view — アニメーションビューの作成・設定・削除 immediate
標準のアニメーションビュー。繰返し・速度・方向・表示レイヤを設定しJDC保存可能。Mode=removeで削除。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("animation.view",
new AnimationViewParameters("動作ビュー", new(1, 1, -1), new(0, 0, 1),
RepeatMode: "count", RepeatCount: 3, Speed: 1), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
direction | 必須 | object |
up | 必須 | object |
repeatMode | 省略可 | string |
repeatCount | 省略可 | integer |
speed | 省略可 | number |
visibleLayers | 省略可 | array / null |
mode | 省略可 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"direction": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"up": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"repeatMode": {
"type": "string"
},
"repeatCount": {
"type": "integer"
},
"speed": {
"type": "number"
},
"visibleLayers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"mode": {
"type": "string"
}
},
"required": [
"name",
"direction",
"up"
]
}layout.activate — 作成済みレイアウトを表示(以後のモデル操作にはモデル表示へ戻す) immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
}layout.annotations — 既存紙面の注釈を文字付き引き出し線へ置換/追加。矢印先端と文字の棚位置を指定。製図ルール: R・穴数・長穴・面取り等の注記は、独立した文字と線ではなく、原則として文字付き引き出し線を使用します。円・円弧の位置やピッチを示す寸法は、意図に応じて正確な中心を基準とし、同じ数値になる接点で代用しません。必要に応じ中心マーク・中心線を付けます。全長・接線・端面基準の寸法は図面の指定に従い、ユーザーが現状維持を指定した寸法は変更しません。 immediate
入力型: LayoutAnnotationsParameters
| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
removeIndices | 必須 | array of integer |
leaders | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"removeIndices": {
"type": "array",
"items": {
"type": "integer"
}
},
"leaders": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"text": {
"type": "string"
},
"anchor": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"landing": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"textHeight": {
"type": "number"
},
"font": {
"type": "string"
},
"elbows": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
{
"type": "null"
}
]
},
"color": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"rgb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"mode"
]
},
{
"type": "null"
}
]
}
},
"required": [
"text",
"anchor",
"landing"
]
}
}
},
"required": [
"name",
"removeIndices",
"leaders"
]
}layout.create — 投影図・紙面図形・実寸表示の寸法を持つレイアウトを作成 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
width | 必須 | number |
height | 必須 | number |
views | 必須 | array of object |
objects | 必須 | array of object |
dimensions | 必須 | array of object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"width": {
"type": "number"
},
"height": {
"type": "number"
},
"views": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"direction": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"up": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"modelOrigin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"paperOrigin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"scale": {
"type": "number"
},
"clip": {
"type": "object",
"additionalProperties": false,
"properties": {
"left": {
"type": "number"
},
"right": {
"type": "number"
},
"bottom": {
"type": "number"
},
"top": {
"type": "number"
}
},
"required": [
"left",
"right",
"bottom",
"top"
]
},
"visibleLayers": {
"type": "array",
"items": {
"type": "string"
}
},
"display": {
"type": "string"
}
},
"required": [
"direction",
"up",
"modelOrigin",
"paperOrigin",
"scale",
"clip",
"visibleLayers"
]
}
},
"objects": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"line": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"end": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"start",
"end"
]
},
{
"type": "null"
}
]
},
"circle": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"radius": {
"type": "number"
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"center",
"radius",
"normal"
]
},
{
"type": "null"
}
]
},
"arc": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"start": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"start",
"normal",
"sweepDegrees"
]
},
{
"type": "null"
}
]
},
"polyline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"vertices": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"closed": {
"type": "boolean"
}
},
"required": [
"vertices"
]
},
{
"type": "null"
}
]
},
"ellipse": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"center": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"majorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"minorAxis": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"startDegrees": {
"type": "number"
},
"sweepDegrees": {
"type": "number"
}
},
"required": [
"center",
"majorAxis",
"minorAxis"
]
},
{
"type": "null"
}
]
},
"spline": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"throughPoints": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"degree": {
"type": "integer"
},
"closed": {
"type": "boolean"
}
},
"required": [
"throughPoints"
]
},
{
"type": "null"
}
]
},
"text": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"content": {
"type": "string"
},
"location": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"xDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"yDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"height": {
"type": "number"
},
"font": {
"type": "string"
}
},
"required": [
"content",
"location",
"xDirection",
"yDirection",
"height"
]
},
{
"type": "null"
}
]
},
"point": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
{
"type": "null"
}
]
}
},
"required": []
}
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"dimension": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"points": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"textPosition": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"direction": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"radius": {
"type": "number"
},
"style": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"points",
"textPosition",
"normal",
"direction"
]
},
"valueScale": {
"type": "number"
},
"textHeight": {
"type": "number"
}
},
"required": [
"dimension"
]
}
}
},
"required": [
"name",
"width",
"height",
"views",
"objects",
"dimensions"
]
}layout.view — 既存レイアウトのビューを追加・更新・削除 immediate
Nameは既存レイアウト名。addはIndex=-1、update/removeはlayoutViewsで取得したIndex。更新はビューの識別情報と用紙注記を保持します。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var layouts = await cad.QueryAsync(new(doc.Id, doc.Revision, "layouts", []), ct);
string layoutName = layouts.Data[0].GetProperty("name").GetString()!;
// クリップ範囲は用紙内に、VisibleLayers は実在するレイヤ名に合わせます。
var request = doc.Operation("layout.view",
new LayoutViewEditParameters(layoutName, "add", View:
new LayoutViewParameters(new(0, 0, -1), new(0, 1, 0),
new(0, 0, 0), new(60, 60, 0), 1,
new(10, 110, 10, 110), ["Standard"], "hiddenLines")), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);
// 更新は Mode="update", Index を指定。削除は Mode="remove", View=null。
// Index と現状は QueryAsync(kind:"layoutViews") で取得してください。| JSON引数 | 必須 | 型 |
|---|---|---|
name | 必須 | string |
mode | 必須 | string |
index | 省略可 | integer |
view | 省略可 | object / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"mode": {
"type": "string"
},
"index": {
"type": "integer"
},
"view": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"direction": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"up": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"modelOrigin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"paperOrigin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"scale": {
"type": "number"
},
"clip": {
"type": "object",
"additionalProperties": false,
"properties": {
"left": {
"type": "number"
},
"right": {
"type": "number"
},
"bottom": {
"type": "number"
},
"top": {
"type": "number"
}
},
"required": [
"left",
"right",
"bottom",
"top"
]
},
"visibleLayers": {
"type": "array",
"items": {
"type": "string"
}
},
"display": {
"type": "string"
}
},
"required": [
"direction",
"up",
"modelOrigin",
"paperOrigin",
"scale",
"clip",
"visibleLayers"
]
},
{
"type": "null"
}
]
}
},
"required": [
"name",
"mode"
]
}section.generate — 指定図形と断面平面からXY断面図を生成 worker
入力型: SectionGenerateParameters
PlaneIdと対象IDを明示。XY上のInsertionPointへ2D断面を追加。元の3D図形と断面平面は保持。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var selection = await cad.GetSelectionAsync(cancellationToken: ct);
string[] ids = selection.Entities.Select(e => e.Id).ToArray();
// ID は今開いている図面から取得します。保存・再起動後は取り直してください。
var planes = await cad.QueryAsync(new(doc.Id, doc.Revision, "sectionPlanes", []), ct);
string planeId = planes.Data[0].GetProperty("entity").GetProperty("id").GetString()!;
var request = doc.Operation("section.generate",
new SectionGenerateParameters(planeId,
ids.Where(id => id != planeId).ToArray(), new(150, 0, 0)), selectResult: false);
var job = await cad.StartOperationAsync(new(request, 180), ct);
while (job.State == "running")
{
await Task.Delay(100, ct);
job = await cad.GetJobAsync(job.Id, ct);
}
if (job.State != "ready") throw new InvalidOperationException(job.Message);
doc = await cad.GetDocumentAsync(ct);
var result = await cad.CommitJobAsync(new(doc.Id, doc.Revision,
Guid.NewGuid().ToString(), job.Id), ct);| JSON引数 | 必須 | 型 |
|---|---|---|
planeId | 必須 | string |
entityIds | 必須 | array of string |
insertionPoint | 必須 | object |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"planeId": {
"type": "string"
},
"entityIds": {
"type": "array",
"items": {
"type": "string"
}
},
"insertionPoint": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
}
},
"required": [
"planeId",
"entityIds",
"insertionPoint"
]
}section.plane — 断面平面の作成・位置/方向/反転・ライブ断面設定 immediate
EntityId未指定で作成、指定で同じ断面平面を更新。Live・Flipped・Activeは別々に設定。法線とXDirectionは直交。
C#での使い方
api は IAddinContext.Api、ct は CancellationToken。名前・寸法・選択対象を図面に合わせて指定してください。
// using JDesignCAD.Api; using System.Linq;
var cad = (ICadWorkspaceApi)api;
var doc = await cad.GetDocumentAsync(ct);
var request = doc.Operation("section.plane",
new SectionPlaneParameters(new(0, 0, 5), new(0, 0, 1), new(1, 0, 0),
Width: 100, Height: 75, Live: true, Flipped: false), selectResult: false);
var result = await cad.ExecuteOperationAsync(request, ct);
// result.Entities[0].Id が平面のID。編集時は EntityId に渡します。
// 反転は Flipped=true、ライブ表示の解除は Live=false。| JSON引数 | 必須 | 型 |
|---|---|---|
origin | 必須 | object |
normal | 必須 | object |
xDirection | 必須 | object |
width | 省略可 | number |
height | 省略可 | number |
live | 省略可 | boolean |
flipped | 省略可 | boolean |
active | 省略可 | boolean |
entityId | 省略可 | string / null |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"origin": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"normal": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"xDirection": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
]
},
"width": {
"type": "number"
},
"height": {
"type": "number"
},
"live": {
"type": "boolean"
},
"flipped": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"entityId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"origin",
"normal",
"xDirection"
]
}view.activate — モデル/レイアウトの表示を切り替え。倍率を維持(zoomToFit指定時だけフィット)。ビュー名はcad_query kind=viewsで取得。図形・Undoは変更しません。 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
kind | 必須 | string |
name | 省略可 | string / null |
zoomToFit | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"zoomToFit": {
"type": "boolean"
}
},
"required": [
"kind"
]
}view.capture — モデル/指定レイアウトをPNGへ描画して確認(図形変更なし) immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
filePath | 必須 | string |
layoutName | 省略可 | string / null |
width | 省略可 | integer |
height | 省略可 | integer |
overwrite | 省略可 | boolean |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"filePath": {
"type": "string"
},
"layoutName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"width": {
"type": "integer"
},
"height": {
"type": "integer"
},
"overwrite": {
"type": "boolean"
}
},
"required": [
"filePath"
]
}08 ファイル
document.open — 既存JDCをこのウィンドウで開く。未保存の変更があれば拒否。Undo対象外。図面未表示時はdocumentId空文字・expectedRevision=0。タイムアウト後は同じoperationIdで再照会。 immediate
| JSON引数 | 必須 | 型 |
|---|---|---|
filePath | 必須 | string |
入れ子を含むJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"filePath": {
"type": "string"
}
},
"required": [
"filePath"
]
}公開型とメソッドの正式定義
引数の順番、既定値、null許可、戻り値は次の定義が基準です。ICadApi等の既存インターフェースは変更せず、追加インターフェースを継承しています。
AnalysisMeshParameters
public sealed record AnalysisMeshParameters(string[] EntityIds,int Dimension,double MeshSize=5,double Tolerance=.01);
AnalysisBoundaryData
public sealed record AnalysisBoundaryData(int Group,int[] Nodes,int Body=0);
AnalysisMeshData
public sealed record AnalysisMeshData(int Dimension,double[][] Points,int[][] Elements,AnalysisBoundaryData[] Boundaries,AnalysisBoundaryData[]? EdgeBoundaries=null,int[]? VertexNodes=null);
AnalysisMaterialData
public sealed record AnalysisMaterialData(string Name="Steel",double YoungModulus=200000,double PoissonRatio=.3,double Density=7850,double Conductivity=50,double SpecificHeat=460,double ExpansionMicro=12);
AnalysisConditionData
public sealed record AnalysisConditionData(string Kind,int Group=0,int Node=-1,string Target="boundary",int[]? Groups=null,int[]? NodeIds=null,int[]? BoundaryIndices=null,double X=0,double Y=0,double Z=0);
AnalysisSolveParameters
public sealed record AnalysisSolveParameters(AnalysisMeshData Mesh,AnalysisMaterialData Material,AnalysisConditionData[] Conditions,string Kind="elastic",double Thickness=1,bool PlaneStrain=false,
bool TransientThermal=false,double InitialTemperature=20,double EndTime=60,double TimeStep=1,int OutputCount=61);ソース全体: AnalysisContracts.cs
namespace JDesignCAD.Api;
/// <summary>Meshing uses selected closed planar profiles (2D) or one solid (3D). Result sections: points/elements/boundaries/summary.</summary>
public sealed record AnalysisMeshParameters(string[] EntityIds,int Dimension,double MeshSize=5,double Tolerance=.01);
public sealed record AnalysisBoundaryData(int Group,int[] Nodes,int Body=0);
/// <summary>Zero-based node indices. Quadratic elements: 8 nodes in 2D, 10/20 in 3D. Single material/body.</summary>
public sealed record AnalysisMeshData(int Dimension,double[][] Points,int[][] Elements,AnalysisBoundaryData[] Boundaries,AnalysisBoundaryData[]? EdgeBoundaries=null,int[]? VertexNodes=null);
/// <summary>Modulus N/mm², density kg/m³, conductivity W/(m K), heat capacity J/(kg K).</summary>
public sealed record AnalysisMaterialData(string Name="Steel",double YoungModulus=200000,double PoissonRatio=.3,double Density=7850,double Conductivity=50,double SpecificHeat=460,double ExpansionMicro=12);
/// <summary>Target boundary/edge/vertex; kind fixed/displacement/force/totalforce/traction/lineforce/temperature/flux/convection/insulated.
/// Loads N, traction N/mm², temperature °C, flux W/mm², convection X in W/(mm² K), Y ambient °C.</summary>
public sealed record AnalysisConditionData(string Kind,int Group=0,int Node=-1,string Target="boundary",int[]? Groups=null,int[]? NodeIds=null,int[]? BoundaryIndices=null,double X=0,double Y=0,double Z=0);
public sealed record AnalysisSolveParameters(AnalysisMeshData Mesh,AnalysisMaterialData Material,AnalysisConditionData[] Conditions,string Kind="elastic",double Thickness=1,bool PlaneStrain=false,
bool TransientThermal=false,double InitialTemperature=20,double EndTime=60,double TimeStep=1,int OutputCount=61);
AnimationViewParameters
public sealed record AnimationViewParameters(string Name, Point3 Direction, Point3 Up,
string RepeatMode="once", int RepeatCount=1, double Speed=1, string[]? VisibleLayers=null, string Mode="upsert");AnimationDriveParameters
public sealed record AnimationDriveParameters(string Name, string Kind, string[] EntityIds,
Point3? AxisOrigin=null, Point3? AxisDirection=null, string? CurveId=null,
string? FirstDrive=null, string? SecondDrive=null, string? DependsOn=null,
double Position=0, double NullPosition=0, bool Tangential=true, bool Stretch=false, string Mode="upsert");AnimationKeyframe
public sealed record AnimationKeyframe(double Time, double Position, bool ToCurveEnd=false);
AnimationTrack
public sealed record AnimationTrack(string Drive, AnimationKeyframe[] Keys);
AnimationScheduleParameters
public sealed record AnimationScheduleParameters(string Name, AnimationTrack[] Tracks, string Mode="upsert");
AnimationControlParameters
public sealed record AnimationControlParameters(string View, string Action, string? Schedule=null,
double Start=0, double? End=null, double? Speed=null);ソース全体: AnimationContracts.cs
namespace JDesignCAD.Api;
/// <summary>Create/update a native animation view. Direction/up use WCS; visible layers omitted means all.
/// Mode is upsert/remove. RepeatMode once/infinite/count; Speed is simulation seconds per real second.</summary>
public sealed record AnimationViewParameters(string Name, Point3 Direction, Point3 Up,
string RepeatMode="once", int RepeatCount=1, double Speed=1, string[]? VisibleLayers=null, string Mode="upsert");
/// <summary>Native drives: axis (degrees), curve (mm from curve start), dualCurve (two curve drives).
/// Update retains identity so existing schedules remain valid. An entity belongs to at most one drive.
/// Mode upsert/remove. Removal fails if another drive or schedule references it.</summary>
public sealed record AnimationDriveParameters(string Name, string Kind, string[] EntityIds,
Point3? AxisOrigin=null, Point3? AxisDirection=null, string? CurveId=null,
string? FirstDrive=null, string? SecondDrive=null, string? DependsOn=null,
double Position=0, double NullPosition=0, bool Tangential=true, bool Stretch=false, string Mode="upsert");
public sealed record AnimationKeyframe(double Time, double Position, bool ToCurveEnd=false);
public sealed record AnimationTrack(string Drive, AnimationKeyframe[] Keys);
/// <summary>Replace a complete native schedule. Times in seconds; at least two distinct times per track.
/// ToCurveEnd binds a position to a curve's current length. Mode upsert/remove.</summary>
public sealed record AnimationScheduleParameters(string Name, AnimationTrack[] Tracks, string Mode="upsert");
/// <summary>Action play/pause/resume/stop. Play requires Schedule. Start/end use simulation seconds.</summary>
public sealed record AnimationControlParameters(string View, string Action, string? Schedule=null,
double Start=0, double? End=null, double? Speed=null);
AssemblyContactsParameters
public sealed record AssemblyContactsParameters(string[] EntityIds, double Tolerance=.01);
AssemblyMeshParameters
public sealed record AssemblyMeshParameters(string[] EntityIds, double MeshSize=5, double Tolerance=.01, int[]? ExcludedContactGroups=null);
AnalysisContactData
public sealed record AnalysisContactData(int Group,int Body1,int Body2,double Area,bool Enabled=true,double[][]? Outline=null);
AssemblyMeshData
public sealed record AssemblyMeshData(AnalysisMeshData Mesh,int[] ElementBodies,string[] BodyNames,
AnalysisContactData[] Contacts,AnalysisBoundaryData[] BodySurfaces);AssemblySolveParameters
public sealed record AssemblySolveParameters(AssemblyMeshData Mesh,AnalysisMaterialData[] BodyMaterials,
AnalysisConditionData[] Conditions,string Kind="elastic",bool TransientThermal=false,
double InitialTemperature=20,double EndTime=60,double TimeStep=1,int OutputCount=61);ソース全体: AssemblyAnalysisContracts.cs
namespace JDesignCAD.Api;
/// <summary>Detect touching faces between 2..100 non-overlapping closed solids. Body IDs are one-based EntityIds order.</summary>
public sealed record AssemblyContactsParameters(string[] EntityIds, double Tolerance=.01);
/// <summary>Mesh an assembly with bonded contacts except ExcludedContactGroups. Detect contacts first using the same solid order.</summary>
public sealed record AssemblyMeshParameters(string[] EntityIds, double MeshSize=5, double Tolerance=.01, int[]? ExcludedContactGroups=null);
public sealed record AnalysisContactData(int Group,int Body1,int Body2,double Area,bool Enabled=true,double[][]? Outline=null);
/// <summary>Use assembly.mesh result sections without dropping the one-based material/body mapping or contact connectivity.</summary>
public sealed record AssemblyMeshData(AnalysisMeshData Mesh,int[] ElementBodies,string[] BodyNames,
AnalysisContactData[] Contacts,AnalysisBoundaryData[] BodySurfaces);
/// <summary>One material per body, in BodyNames order. Contacts are fixed at meshing time; remesh to change them.</summary>
public sealed record AssemblySolveParameters(AssemblyMeshData Mesh,AnalysisMaterialData[] BodyMaterials,
AnalysisConditionData[] Conditions,string Kind="elastic",bool TransientThermal=false,
double InitialTemperature=20,double EndTime=60,double TimeStep=1,int OutputCount=61);
DocumentRequest
public sealed record DocumentRequest(string DocumentId, long ExpectedRevision);
OperationRequest
public sealed record OperationRequest(string DocumentId, long ExpectedRevision, string OperationId,
string Operation, JsonElement Parameters, bool SelectResult = true);OperationInfo
public sealed record OperationInfo(string Name, string Description, string ParameterType, string Execution,
bool Available, string? UnavailableReason = null)
{
public string? UnavailableCode { get; init; }
public LicenseRestriction? LicenseRestriction { get; init; }
}OperationSchema
public sealed record OperationSchema(OperationInfo Operation, JsonElement ParametersSchema);
CapabilityInfo
public sealed record CapabilityInfo(int Major, int Minor, string CoordinateSystem, string LengthUnit,
OperationInfo[] Operations, string[] Limitations)
{
public LicenseCapabilities? License { get; init; }
public FileFormatInfo[]? FileFormats { get; init; }
/// <summary>Input methods are separate from geometry operations; points are supplied by the user in CAD.</summary>
public string[]? InputMethods { get; init; }
}TopologyRequest
public sealed record TopologyRequest(string DocumentId, long ExpectedRevision, string EntityId,
string Kind = "face", int Offset = 0, int Limit = 128);SubobjectRef
public sealed record SubobjectRef(string EntityId, long Revision, string Kind, int Index);
TopologyItem
public sealed record TopologyItem(SubobjectRef Reference, string GeometryType, Bounds3? Bounds,
Point3? Position = null, Point3? Normal = null, double? Length = null);TopologyPage
public sealed record TopologyPage(DocumentInfo Document, TopologyItem[] Items, int Total, int Offset);
CadColor
public sealed record CadColor(string Mode, string? Rgb = null);
AttributeInfo
public sealed record AttributeInfo(EntityInfo Entity, CadColor? Color, string? LinePattern, string? LineWidth,
bool LayerLocked);AttributePage
public sealed record AttributePage(DocumentInfo Document, AttributeInfo[] Items);
LayerInfo
public sealed record LayerInfo(string Name, CadColor Color, string? LinePattern, string? LineWidth,
bool Locked, int Transparency, bool Current);LayerPage
public sealed record LayerPage(DocumentInfo Document, LayerInfo[] Layers, string[] LinePatterns, string[] LineWidths);
SetAttributesParameters
public sealed record SetAttributesParameters(string[] EntityIds, string? Layer = null, CadColor? Color = null,
string? LinePattern = null, string? LineWidth = null);SetLayerParameters
public sealed record SetLayerParameters(string Name, CadColor? Color = null, bool? Locked = null,
int? Transparency = null, bool MakeCurrent = false, string? LinePattern = null, string? LineWidth = null);DeleteLayerParameters
public sealed record DeleteLayerParameters(string Name);
RotateParameters
public sealed record RotateParameters(string[] EntityIds, Point3 Center, Point3 Axis, double AngleDegrees, bool Copy = false);
ScaleParameters
public sealed record ScaleParameters(string[] EntityIds, Point3 Center, double Factor, bool Copy = false);
MirrorParameters
public sealed record MirrorParameters(string[] EntityIds, Point3 PlaneOrigin, Point3 PlaneNormal, bool Copy = false);
LinearArrayParameters
public sealed record LinearArrayParameters(string[] EntityIds, Point3 Step, int Count, bool IncludeOriginalCopy = false);
CircularArrayParameters
public sealed record CircularArrayParameters(string[] EntityIds, Point3 Center, Point3 Axis, double StepDegrees, int Count);
GeometryDefinition
public sealed record GeometryDefinition(LineDefinition? Line = null, CircleDefinition? Circle = null,
ArcDefinition? Arc = null, PolylineDefinition? Polyline = null, EllipseDefinition? Ellipse = null,
SplineDefinition? Spline = null, TextDefinition? Text = null, Point3? Point = null);EllipseDefinition
public sealed record EllipseDefinition(Point3 Center, Point3 MajorAxis, Point3 MinorAxis,
double StartDegrees = 0, double SweepDegrees = 360);SplineDefinition
public sealed record SplineDefinition(Point3[] ThroughPoints, int Degree = 3, bool Closed = false);
TextDefinition
public sealed record TextDefinition(string Content, Point3 Location, Point3 XDirection, Point3 YDirection,
double Height, string Font = "Arial");CreateObjectsParameters
public sealed record CreateObjectsParameters(GeometryDefinition[] Objects);
GeometryUpdate
public sealed record GeometryUpdate(string EntityId, GeometryDefinition Geometry);
UpdateGeometryParameters
public sealed record UpdateGeometryParameters(GeometryUpdate[] Updates);
TrimCurveParameters
public sealed record TrimCurveParameters(string EntityId, double StartParameter, double EndParameter);
ソース全体: AutomationContracts.cs
using System.Text.Json;
namespace JDesignCAD.Api;
/// <summary>Discoverable operations shared by DLL extensions and MCP. Added without changing v1/v1.1 interfaces.</summary>
public interface ICadAutomationApi : ICadModelApi
{
Task<CapabilityInfo> GetCapabilitiesAsync(CancellationToken cancellationToken = default);
Task<OperationSchema> GetOperationSchemaAsync(string operation, CancellationToken cancellationToken = default);
Task<TopologyPage> GetTopologyAsync(TopologyRequest request, CancellationToken cancellationToken = default);
Task<AttributePage> GetAttributesAsync(EntityDetailsRequest request, CancellationToken cancellationToken = default);
Task<LayerPage> GetLayersAsync(DocumentRequest request, CancellationToken cancellationToken = default);
Task<EditResult> ExecuteOperationAsync(OperationRequest request, CancellationToken cancellationToken = default);
}
/// <summary>All geometry uses WCS millimetres, angles use degrees. Check the current revision before every edit.</summary>
public sealed record DocumentRequest(string DocumentId, long ExpectedRevision);
/// <summary>Operation is an explicitly registered name; Parameters must match its documented parameter type.
/// Unknown operations/fields are rejected. OperationId is a fresh UUID, reused unchanged only for retries.</summary>
public sealed record OperationRequest(string DocumentId, long ExpectedRevision, string OperationId,
string Operation, JsonElement Parameters, bool SelectResult = true);
public sealed record OperationInfo(string Name, string Description, string ParameterType, string Execution,
bool Available, string? UnavailableReason = null)
{
public string? UnavailableCode { get; init; }
public LicenseRestriction? LicenseRestriction { get; init; }
}
public sealed record OperationSchema(OperationInfo Operation, JsonElement ParametersSchema);
public sealed record CapabilityInfo(int Major, int Minor, string CoordinateSystem, string LengthUnit,
OperationInfo[] Operations, string[] Limitations)
{
public LicenseCapabilities? License { get; init; }
public FileFormatInfo[]? FileFormats { get; init; }
/// <summary>Input methods are separate from geometry operations; points are supplied by the user in CAD.</summary>
public string[]? InputMethods { get; init; }
}
/// <summary>Read faces, edges or vertices in one top-level Solid/Shell/Face. Kind: face, edge, vertex.
/// References expire whenever the document revision changes. Page limit 1..256.</summary>
public sealed record TopologyRequest(string DocumentId, long ExpectedRevision, string EntityId,
string Kind = "face", int Offset = 0, int Limit = 128);
public sealed record SubobjectRef(string EntityId, long Revision, string Kind, int Index);
public sealed record TopologyItem(SubobjectRef Reference, string GeometryType, Bounds3? Bounds,
Point3? Position = null, Point3? Normal = null, double? Length = null);
public sealed record TopologyPage(DocumentInfo Document, TopologyItem[] Items, int Total, int Offset);
/// <summary>Color mode: byLayer, byBlock, foreground, rgb. RGB is six hexadecimal digits without #.</summary>
public sealed record CadColor(string Mode, string? Rgb = null);
public sealed record AttributeInfo(EntityInfo Entity, CadColor? Color, string? LinePattern, string? LineWidth,
bool LayerLocked);
public sealed record AttributePage(DocumentInfo Document, AttributeInfo[] Items);
public sealed record LayerInfo(string Name, CadColor Color, string? LinePattern, string? LineWidth,
bool Locked, int Transparency, bool Current);
public sealed record LayerPage(DocumentInfo Document, LayerInfo[] Layers, string[] LinePatterns, string[] LineWidths);
/// <summary>Omitted fields are unchanged. Layer/line style names must exist. Locked source/destination layers are rejected.</summary>
public sealed record SetAttributesParameters(string[] EntityIds, string? Layer = null, CadColor? Color = null,
string? LinePattern = null, string? LineWidth = null);
/// <summary>Create or update a named layer. Layer colors must be rgb or foreground. Transparency is 0..255.</summary>
public sealed record SetLayerParameters(string Name, CadColor? Color = null, bool? Locked = null,
int? Transparency = null, bool MakeCurrent = false, string? LinePattern = null, string? LineWidth = null);
public sealed record DeleteLayerParameters(string Name);
public sealed record RotateParameters(string[] EntityIds, Point3 Center, Point3 Axis, double AngleDegrees, bool Copy = false);
/// <summary>Uniform positive scaling. Sheet-metal metadata must be edited using sheet-metal dimensions instead.</summary>
public sealed record ScaleParameters(string[] EntityIds, Point3 Center, double Factor, bool Copy = false);
public sealed record MirrorParameters(string[] EntityIds, Point3 PlaneOrigin, Point3 PlaneNormal, bool Copy = false);
/// <summary>Copies include the original placement only when IncludeOriginalCopy=true. Maximum 1000 results.</summary>
public sealed record LinearArrayParameters(string[] EntityIds, Point3 Step, int Count, bool IncludeOriginalCopy = false);
public sealed record CircularArrayParameters(string[] EntityIds, Point3 Center, Point3 Axis, double StepDegrees, int Count);
/// <summary>Exactly one geometry field must be specified. X/Y axes of ellipses/text must be perpendicular.</summary>
public sealed record GeometryDefinition(LineDefinition? Line = null, CircleDefinition? Circle = null,
ArcDefinition? Arc = null, PolylineDefinition? Polyline = null, EllipseDefinition? Ellipse = null,
SplineDefinition? Spline = null, TextDefinition? Text = null, Point3? Point = null);
public sealed record EllipseDefinition(Point3 Center, Point3 MajorAxis, Point3 MinorAxis,
double StartDegrees = 0, double SweepDegrees = 360);
/// <summary>Interpolating spline through 2..4096 distinct consecutive points. Degree 1..5.</summary>
public sealed record SplineDefinition(Point3[] ThroughPoints, int Degree = 3, bool Closed = false);
public sealed record TextDefinition(string Content, Point3 Location, Point3 XDirection, Point3 YDirection,
double Height, string Font = "Arial");
public sealed record CreateObjectsParameters(GeometryDefinition[] Objects);
/// <summary>Replace geometric data of an existing object of the same native type; keeps its ID and attributes.</summary>
public sealed record GeometryUpdate(string EntityId, GeometryDefinition Geometry);
public sealed record UpdateGeometryParameters(GeometryUpdate[] Updates);
public sealed record TrimCurveParameters(string EntityId, double StartParameter, double EndParameter);
public static class AutomationExtensions
{
/// <summary>Create an operation request using a documented parameter record.</summary>
public static OperationRequest Operation<T>(this DocumentInfo document, string operation, T parameters,
bool selectResult = true, string? operationId = null) =>
new(document.Id, document.Revision, operationId ?? Guid.NewGuid().ToString("D"), operation,
JsonSerializer.SerializeToElement(parameters, LocalProtocol.Json), selectResult);
}
Point3
public sealed record Point3(double X, double Y, double Z);
Bounds3
public sealed record Bounds3(Point3 Minimum, Point3 Maximum);
EntityInfo
public sealed record EntityInfo(string Id, string Kind, string? Layer, Bounds3? Bounds);
DocumentInfo
public sealed record DocumentInfo(string Id, string? FileName, long Revision, int ObjectCount,
bool CanUndo, bool CanRedo, string LengthUnit = "mm", string CoordinateSystem = "WCS");SelectionInfo
public sealed record SelectionInfo(DocumentInfo Document, EntityInfo[] Entities, int Total, int Offset);
LineDefinition
public sealed record LineDefinition(Point3 Start, Point3 End);
CircleDefinition
public sealed record CircleDefinition(Point3 Center, double Radius, Point3 Normal);
CreateGeometryRequest
public sealed record CreateGeometryRequest(string DocumentId, long ExpectedRevision, string OperationId,
LineDefinition[] Lines, CircleDefinition[] Circles, bool SelectCreated = true);HistoryRequest
public sealed record HistoryRequest(string DocumentId, long ExpectedRevision, string OperationId);
EditResult
public sealed record EditResult(DocumentInfo Document, EntityInfo[] Entities, bool Changed);
LicenseRestriction
public sealed record LicenseRestriction(string Feature, string Operation, string CurrentPlan, string[] RequiredPlans, bool Retryable = false);
LicenseCapabilities
public sealed record LicenseCapabilities(string CurrentPlan, bool CustomAddinsAllowed, bool McpAvailable = true, string FreeAddinPolicy = "bundled_sample_only");
CommandResult
public sealed record CommandResult(string Message);
RibbonButton
public sealed record RibbonButton(string Id, string Text, string Description, IAddinCommand Command,
bool RequiresDocument = true, string? SmallIconPath = null, string? LargeIconPath = null);RibbonPanel
public sealed record RibbonPanel(string Id, string Text, RibbonButton[] Buttons);
RibbonTab
public sealed record RibbonTab(string Id, string Text, RibbonPanel[] Panels);
ソース全体: Contracts.cs
namespace JDesignCAD.Api;
/// <summary>Version 1: WCS coordinates and lengths are millimetres, independent of display units.
/// Handles identify objects only within the current open document session.</summary>
public static class ApiVersion { public const int Major = 1; public const int Minor = 8; }
public sealed record Point3(double X, double Y, double Z);
public sealed record Bounds3(Point3 Minimum, Point3 Maximum);
public sealed record EntityInfo(string Id, string Kind, string? Layer, Bounds3? Bounds);
public sealed record DocumentInfo(string Id, string? FileName, long Revision, int ObjectCount,
bool CanUndo, bool CanRedo, string LengthUnit = "mm", string CoordinateSystem = "WCS");
public sealed record SelectionInfo(DocumentInfo Document, EntityInfo[] Entities, int Total, int Offset);
public sealed record LineDefinition(Point3 Start, Point3 End);
public sealed record CircleDefinition(Point3 Center, double Radius, Point3 Normal);
/// <summary>All definitions are validated before insertion. The batch is one Undo step.
/// OperationId is a caller-generated UUID; retry the identical request after a transport interruption.</summary>
public sealed record CreateGeometryRequest(string DocumentId, long ExpectedRevision, string OperationId,
LineDefinition[] Lines, CircleDefinition[] Circles, bool SelectCreated = true);
public sealed record HistoryRequest(string DocumentId, long ExpectedRevision, string OperationId);
public sealed record EditResult(DocumentInfo Document, EntityInfo[] Entities, bool Changed);
public sealed class CadApiException : Exception
{
public string Code { get; }
public LicenseRestriction? LicenseRestriction { get; init; }
public CadApiException(string code, string message) : base(message) { Code = code; }
}
/// <summary>Machine-readable denial; retrying unchanged requests cannot unlock a licensed feature.</summary>
public sealed record LicenseRestriction(string Feature, string Operation, string CurrentPlan, string[] RequiredPlans, bool Retryable = false);
public sealed record LicenseCapabilities(string CurrentPlan, bool CustomAddinsAllowed, bool McpAvailable = true, string FreeAddinPolicy = "bundled_sample_only");
/// <summary>UI-independent API shared by in-process add-ins and the local MCP bridge.
/// Calls are marshalled by the host. Cancellation prevents queued work from starting;
/// once a short atomic edit starts it completes before returning.</summary>
public interface ICadApi
{
Task<DocumentInfo> GetDocumentAsync(CancellationToken cancellationToken = default);
Task<SelectionInfo> GetSelectionAsync(int offset = 0, int limit = 256, CancellationToken cancellationToken = default);
Task<EditResult> CreateGeometryAsync(CreateGeometryRequest request, CancellationToken cancellationToken = default);
Task<EditResult> UndoAsync(HistoryRequest request, CancellationToken cancellationToken = default);
Task<EditResult> RedoAsync(HistoryRequest request, CancellationToken cancellationToken = default);
}
public sealed record CommandResult(string Message);
public interface IAddinCommand
{
Task<CommandResult> ExecuteAsync(ICadApi api, CancellationToken cancellationToken);
}
public sealed record RibbonButton(string Id, string Text, string Description, IAddinCommand Command,
bool RequiresDocument = true, string? SmallIconPath = null, string? LargeIconPath = null);
public sealed record RibbonPanel(string Id, string Text, RibbonButton[] Buttons);
public sealed record RibbonTab(string Id, string Text, RibbonPanel[] Panels);
public interface IAddinContext
{
ICadApi Api { get; }
string AddinDirectory { get; }
/// <summary>Call only during OnStartup. Registrations are committed after startup succeeds.</summary>
void RegisterTab(RibbonTab tab);
}
public interface ICadAddin
{
void OnStartup(IAddinContext context);
void OnShutdown();
}
ContourMeasureParameters
public sealed record ContourMeasureParameters(string SeedId, string[] CandidateIds,
Point3 Origin, Point3 Normal, Point3 XDirection);ContourHighlightParameters
public sealed record ContourHighlightParameters(ContourMeasureParameters? Contour = null, bool Clear = false);
LayoutViewEditParameters
public sealed record LayoutViewEditParameters(string Name, string Mode, int Index = -1, LayoutViewParameters? View = null);
SectionPlaneParameters
public sealed record SectionPlaneParameters(Point3 Origin, Point3 Normal, Point3 XDirection,
double Width = 100, double Height = 75, bool Live = false, bool Flipped = false, bool Active = true, string? EntityId = null);SectionGenerateParameters
public sealed record SectionGenerateParameters(string PlaneId, string[] EntityIds, Point3 InsertionPoint);
LineWidthParameters
public sealed record LineWidthParameters(string Name, double Width, bool MakeCurrent = false, string Scale = "layout");
LinePatternParameters
public sealed record LinePatternParameters(string Name, double[] Pattern, bool MakeCurrent = false, string Scale = "layout");
ClothoidParameters
public sealed record ClothoidParameters(Point3 First, Point3 Direction, Point3 Normal,
double Parameter, double StartLength, double EndLength, bool Clockwise = false, bool ChordDirection = false, string? EntityId = null);ClothoidBasicParameters
public sealed record ClothoidBasicParameters(Point3 Entry, Point3 Intersection, Point3 Exit,
Point3 Normal, double Parameter, double Radius);ClothoidStationParameters
public sealed record ClothoidStationParameters(string EntityId, double Start, double Left, double Right,
Point3 Normal, double? Interval = null, bool Tangent = false);ソース全体: CoverageContracts.cs
namespace JDesignCAD.Api;
/// <summary>Explicit candidates avoid including hidden or unrelated drawing curves.
/// Plane axes define the centroid coordinates and second moments. The seed must belong to CandidateIds.</summary>
public sealed record ContourMeasureParameters(string SeedId, string[] CandidateIds,
Point3 Origin, Point3 Normal, Point3 XDirection);
/// <summary>Shows the same recognized region as measure.contour. Clear=true removes only the API overlay.</summary>
public sealed record ContourHighlightParameters(ContourMeasureParameters? Contour = null, bool Clear = false);
/// <summary>Mode add/update/remove. Index is required for update/remove and expires with the revision.
/// View is required for add/update. Paper annotations are retained.</summary>
public sealed record LayoutViewEditParameters(string Name, string Mode, int Index = -1, LayoutViewParameters? View = null);
/// <summary>Create/update a native section plane. Omit EntityId to create. Flipped reverses the clipping side.</summary>
public sealed record SectionPlaneParameters(Point3 Origin, Point3 Normal, Point3 XDirection,
double Width = 100, double Height = 75, bool Live = false, bool Flipped = false, bool Active = true, string? EntityId = null);
/// <summary>Generates native XY section curves from explicit source entities; source geometry is retained.</summary>
public sealed record SectionGenerateParameters(string PlaneId, string[] EntityIds, Point3 InsertionPoint);
/// <summary>Register or update a named line width. Scale: layout (paper mm), world (model mm), device (pixels).
/// MakeCurrent applies to subsequent drawing.</summary>
public sealed record LineWidthParameters(string Name, double Width, bool MakeCurrent = false, string Scale = "layout");
/// <summary>Alternating positive stroke/gap lengths in mm; [] denotes continuous. An even number of entries is required.</summary>
public sealed record LinePatternParameters(string Name, double[] Pattern, bool MakeCurrent = false, string Scale = "layout");
/// <summary>Native clothoid A parameter and distances in mm. First is the origin unless ChordDirection=true,
/// when it is the starting point. EntityId updates an existing clothoid, retaining its attributes and ID.</summary>
public sealed record ClothoidParameters(Point3 First, Point3 Direction, Point3 Normal,
double Parameter, double StartLength, double EndLength, bool Clockwise = false, bool ChordDirection = false, string? EntityId = null);
/// <summary>Symmetric spiral/circular arc/spiral through two tangent directions.</summary>
public sealed record ClothoidBasicParameters(Point3 Entry, Point3 Intersection, Point3 Exit,
Point3 Normal, double Parameter, double Radius);
/// <summary>Native station lines on a clothoid. Interval=null makes one line. Tangent=true requires Interval=null.</summary>
public sealed record ClothoidStationParameters(string EntityId, double Start, double Left, double Right,
Point3 Normal, double? Interval = null, bool Tangent = false);
SaveDocumentRequest
public sealed record SaveDocumentRequest(string DocumentId, long ExpectedRevision, string OperationId,
string FilePath, string Format, bool Overwrite = false, int TimeoutSeconds = 300);ExportDocumentRequest
public sealed record ExportDocumentRequest(string DocumentId, long ExpectedRevision, string OperationId,
string FilePath, string Format, bool Overwrite = false, string[]? EntityIds = null,
Point3? BasePoint = null, IfcFileOptions? Ifc = null, int TimeoutSeconds = 300);IfcFileOptions
public sealed record IfcFileOptions(string Output = "ifc4Advanced", string? Name = null);
FileFormatInfo
public sealed record FileFormatInfo(string Format, string[] Extensions, bool CanSave, bool CanExport,
bool Available, string Description, string? UnavailableCode = null, LicenseRestriction? LicenseRestriction = null);FileOutputError
public sealed record FileOutputError(string Code, string Message, bool Retryable = false,
LicenseRestriction? LicenseRestriction = null);FileOutputArtifact
public sealed record FileOutputArtifact(string FilePath, long Bytes, string Sha256);
FileOperationInfo
public sealed record FileOperationInfo(string OperationId, string DocumentId, long SourceRevision,
string Kind, string FilePath, string Format, string State, bool DocumentSaved = false,
long? Bytes = null, string? Sha256 = null, string[]? Warnings = null, FileOutputError? Error = null)
{
/// <summary>OBJ's uniquely named MTL sidecar. Keep these files beside the main output when transferring it.</summary>
public FileOutputArtifact[] AdditionalFiles { get; init; } = [];
}ソース全体: FileContracts.cs
namespace JDesignCAD.Api;
/// <summary>File output API v1.4. Start requests return a tracked operation, not a saving dialog.
/// Poll GetFileOperationAsync until completed/failed/cancelled. File output is not undone by geometry Undo.</summary>
public interface ICadFileApi : ICadInteractionApi
{
Task<FileFormatInfo[]> GetFileFormatsAsync(CancellationToken cancellationToken = default);
Task<FileOperationInfo> SaveDocumentAsync(SaveDocumentRequest request, CancellationToken cancellationToken = default);
Task<FileOperationInfo> ExportDocumentAsync(ExportDocumentRequest request, CancellationToken cancellationToken = default);
Task<FileOperationInfo> GetFileOperationAsync(string operationId, CancellationToken cancellationToken = default);
Task<FileOperationInfo> CancelFileOperationAsync(string operationId, CancellationToken cancellationToken = default);
}
/// <summary>Save the complete drawing and change its current filename only on completion.
/// Absolute FilePath; its extension must agree with Format. Overwrite defaults to false.
/// A fresh UUID OperationId identifies this request; retry only identical requests.</summary>
public sealed record SaveDocumentRequest(string DocumentId, long ExpectedRevision, string OperationId,
string FilePath, string Format, bool Overwrite = false, int TimeoutSeconds = 300);
/// <summary>Write a copy without changing the drawing filename, dirty state or Undo history.
/// Null EntityIds exports the complete project (mesh/STEP/SVG/IFC use its active model).
/// Explicit 1..1000 top-level IDs export only those objects; BasePoint applies only to explicit selection, in WCS mm.</summary>
public sealed record ExportDocumentRequest(string DocumentId, long ExpectedRevision, string OperationId,
string FilePath, string Format, bool Overwrite = false, string[]? EntityIds = null,
Point3? BasePoint = null, IfcFileOptions? Ifc = null, int TimeoutSeconds = 300);
/// <summary>IFC component export: ifc4Advanced, ifc4Faceted or ifc2x3Faceted.
/// Existing metadata is retained for one component; Name optionally overrides it. Multiple solids form one component.</summary>
public sealed record IfcFileOptions(string Output = "ifc4Advanced", string? Name = null);
public sealed record FileFormatInfo(string Format, string[] Extensions, bool CanSave, bool CanExport,
bool Available, string Description, string? UnavailableCode = null, LicenseRestriction? LicenseRestriction = null);
public sealed record FileOutputError(string Code, string Message, bool Retryable = false,
LicenseRestriction? LicenseRestriction = null);
public sealed record FileOutputArtifact(string FilePath, long Bytes, string Sha256);
/// <summary>Only State=completed confirms output exists. Bytes/Sha256 identify the committed file.
/// running means poll again; failed/cancelled leave the destination uncommitted. Warnings report lossy exchange details.</summary>
public sealed record FileOperationInfo(string OperationId, string DocumentId, long SourceRevision,
string Kind, string FilePath, string Format, string State, bool DocumentSaved = false,
long? Bytes = null, string? Sha256 = null, string[]? Warnings = null, FileOutputError? Error = null)
{
/// <summary>OBJ's uniquely named MTL sidecar. Keep these files beside the main output when transferring it.</summary>
public FileOutputArtifact[] AdditionalFiles { get; init; } = [];
}
FillAppearance
public sealed record FillAppearance(CadColor Color, string Pattern = "none",
CadColor? Color2 = null, double AngleDegrees = 0, int Transparency = 0);FillDefinition
public sealed record FillDefinition(GeometryDefinition Boundary, FillAppearance Appearance, string? Layer = null);
CreateFillsParameters
public sealed record CreateFillsParameters(FillDefinition[] Fills);
SetFillParameters
public sealed record SetFillParameters(string[] EntityIds, FillAppearance Appearance);
ソース全体: FillContracts.cs
namespace JDesignCAD.Api;
/// <summary>Solid or two-colour fill. Pattern: none, linear, cylinder, inverseCylinder,
/// spherical, hemispherical, curved, inverseCurved. Angle is in the boundary plane,
/// in degrees. Transparency: 0 opaque .. 255 transparent.</summary>
public sealed record FillAppearance(CadColor Color, string Pattern = "none",
CadColor? Color2 = null, double AngleDegrees = 0, int Transparency = 0);
/// <summary>Exactly one closed planar curve definition. Boundary is embedded in the
/// native hatch, not added as a separate stroked object.</summary>
public sealed record FillDefinition(GeometryDefinition Boundary, FillAppearance Appearance, string? Layer = null);
/// <summary>Create 1..256 native filled shapes in order, as one undoable batch.</summary>
public sealed record CreateFillsParameters(FillDefinition[] Fills);
/// <summary>Replace appearance of existing native solid hatches; retain boundaries and IDs.</summary>
public sealed record SetFillParameters(string[] EntityIds, FillAppearance Appearance);
HelixParameters
public sealed record HelixParameters(Point3 Center, Point3 Axis, double BaseRadius, double TopRadius,
double Height, double Turns, int SegmentsPerTurn = 48, bool Clockwise = false, Point3? StartDirection = null);ソース全体: HelixContracts.cs
namespace JDesignCAD.Api;
/// <summary>geometry.helix: smooth spline path in WCS millimetres. Axis determines the height direction;
/// StartDirection (optional) determines the start phase after projection onto the radius plane.
/// Height may be negative. Radius varies linearly from BaseRadius to TopRadius. Turns is positive,
/// Clockwise reverses winding viewed along the positive axis. SegmentsPerTurn controls interpolation sampling.
/// Returns one open Path. Use geometry.sweep with a profile normal to its start tangent to create a spring.</summary>
public sealed record HelixParameters(Point3 Center, Point3 Axis, double BaseRadius, double TopRadius,
double Height, double Turns, int SegmentsPerTurn = 48, bool Clockwise = false, Point3? StartDirection = null);
ImportImageParameters
public sealed record ImportImageParameters(string FilePath, Point3 Location, Point3 WidthAxis, Point3 HeightAxis);
ソース全体: ImageContracts.cs
namespace JDesignCAD.Api; /// <summary>Embed raster pixels. Location is lower-left; axes are full displayed dimensions in WCS mm.</summary> public sealed record ImportImageParameters(string FilePath, Point3 Location, Point3 WidthAxis, Point3 HeightAxis);
CadInputRequest
public sealed record CadInputRequest(string DocumentId, long ExpectedRevision, string OperationId,
string Kind, string Prompt, PointInputOptions? PointOptions = null,
SelectionInputOptions? SelectionOptions = null, ValueInputOptions? ValueOptions = null, bool AllowNone = false);PointInputOptions
public sealed record PointInputOptions(Point3? BasePoint = null, bool RubberBand = true);
SelectionFilter
public sealed record SelectionFilter(string[]? Kinds = null, string[]? Layers = null, bool IncludeLocked = false);
SelectionInputOptions
public sealed record SelectionInputOptions(SelectionFilter? Filter = null, bool UsePreselection = false,
int MinimumCount = 1, int MaximumCount = 1000, string Target = "entity");ValueInputOptions
public sealed record ValueInputOptions(string? DefaultText = null, double? DefaultNumber = null,
double? Minimum = null, double? Maximum = null, string[]? Keywords = null, bool AllowSpaces = true);CadInputResult
public sealed record CadInputResult(string InputId, string Kind, string State, DocumentInfo Document,
Point3? Point = null, double? Number = null, string? Text = null, EntityInfo[]? Entities = null,
Point3? PickPoint = null, Point3? CursorPoint = null, string? Reason = null)
{
public bool Accepted => State == "accepted";
/// <summary>Face/edge picks from a top-level body, with the same index/revision convention as GetTopologyAsync.
/// Entities contains the owning bodies. Subobject selection uses clicks, not window/preselection.</summary>
public SubobjectRef[]? Subobjects { get; init; }
}InputPreviewRequest
public sealed record InputPreviewRequest(string InputId, LineDefinition[] Lines, CircleDefinition[] Circles);
SelectionRegionRequest
public sealed record SelectionRegionRequest(string DocumentId, long ExpectedRevision, string Mode,
Point3? First = null, Point3? Second = null, SelectionFilter? Filter = null, bool SetSelection = true);ソース全体: InputContracts.cs
namespace JDesignCAD.Api;
/// <summary>Independent user input. Input never creates drawing geometry. Add-ins await the async extensions;
/// remote clients start input and poll without occupying the transport while the user operates CAD.</summary>
public interface ICadInputApi : ICadInteractionApi
{
Task<CadInputResult> StartInputAsync(CadInputRequest request, CancellationToken cancellationToken = default);
Task<CadInputResult> GetInputAsync(string inputId, CancellationToken cancellationToken = default);
Task<CadInputResult> CancelInputAsync(string inputId, CancellationToken cancellationToken = default);
Task<CadInputResult> UpdateInputPreviewAsync(InputPreviewRequest request, CancellationToken cancellationToken = default);
Task<SelectionInfo> SelectRegionAsync(SelectionRegionRequest request, CancellationToken cancellationToken = default);
}
/// <summary>Kind: point, corner, distance, angle, integer, double, string, keyword, entity, selection.
/// Coordinates/lengths are WCS mm; angles are degrees. A new operation UUID is also the input ID.</summary>
public sealed record CadInputRequest(string DocumentId, long ExpectedRevision, string OperationId,
string Kind, string Prompt, PointInputOptions? PointOptions = null,
SelectionInputOptions? SelectionOptions = null, ValueInputOptions? ValueOptions = null, bool AllowNone = false);
/// <summary>BasePoint enables tracking and optional rubber band. Corner and angle use the active drawing plane.
/// Distance is the 3D distance from BasePoint.</summary>
public sealed record PointInputOptions(Point3? BasePoint = null, bool RubberBand = true);
/// <summary>OR within each kinds/layers list, AND across lists. Kinds are exact entity Kind values (case-insensitive).
/// Hidden objects are excluded. Locked objects are excluded unless IncludeLocked is true.</summary>
public sealed record SelectionFilter(string[]? Kinds = null, string[]? Layers = null, bool IncludeLocked = false);
/// <summary>Click toggles membership; drag left to right selects contained objects, right to left selects crossing objects.
/// Enter/OK accepts multiple selection. Entity input accepts one click. Preselection is filtered before reuse.</summary>
public sealed record SelectionInputOptions(SelectionFilter? Filter = null, bool UsePreselection = false,
int MinimumCount = 1, int MaximumCount = 1000, string Target = "entity");
/// <summary>Numeric bounds are inclusive; integers are Int32 values. Keywords accepts an exact choice or an
/// unambiguous case-insensitive prefix. Defaults are not accepted until the user confirms.</summary>
public sealed record ValueInputOptions(string? DefaultText = null, double? DefaultNumber = null,
double? Minimum = null, double? Maximum = null, string[]? Keywords = null, bool AllowSpaces = true);
/// <summary>State: waiting, accepted, none, cancelled. Accepted values depend on Kind. CursorPoint is provisional.
/// Esc and cancellation create no geometry/Undo record. Document binds subsequent edits.</summary>
public sealed record CadInputResult(string InputId, string Kind, string State, DocumentInfo Document,
Point3? Point = null, double? Number = null, string? Text = null, EntityInfo[]? Entities = null,
Point3? PickPoint = null, Point3? CursorPoint = null, string? Reason = null)
{
public bool Accepted => State == "accepted";
/// <summary>Face/edge picks from a top-level body, with the same index/revision convention as GetTopologyAsync.
/// Entities contains the owning bodies. Subobject selection uses clicks, not window/preselection.</summary>
public SubobjectRef[]? Subobjects { get; init; }
}
/// <summary>Replace the active input's transient preview with lines/circles (maximum 256 total). Empty arrays clear it.
/// Preview objects never enter the model, saved file, selection or Undo history.</summary>
public sealed record InputPreviewRequest(string InputId, LineDefinition[] Lines, CircleDefinition[] Circles);
/// <summary>Mode: all, window or crossing. Rectangle points are WCS points projected into the current view.
/// SetSelection replaces highlight; false only returns matching top-level entities (maximum 1000).</summary>
public sealed record SelectionRegionRequest(string DocumentId, long ExpectedRevision, string Mode,
Point3? First = null, Point3? Second = null, SelectionFilter? Filter = null, bool SetSelection = true);
public static class CadInputExtensions
{
/// <summary>Await actual user completion. Never use .Result/.Wait() on the UI thread.
/// Esc returns cancelled; token cancellation cancels this input and throws OperationCanceledException.</summary>
public static async Task<CadInputResult> PromptAsync(this ICadInputApi api, CadInputRequest request,
CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(api); ArgumentNullException.ThrowIfNull(request);
cancellationToken.ThrowIfCancellationRequested();
try
{
var result = await api.StartInputAsync(request, cancellationToken);
while (result.State == "waiting")
{
await Task.Delay(50, cancellationToken);
result = await api.GetInputAsync(result.InputId, cancellationToken);
}
return result;
}
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
{
try { await api.CancelInputAsync(request.OperationId, CancellationToken.None); }
catch (CadApiException) { }
throw;
}
}
private static CadInputRequest Request(DocumentInfo d,string kind,string prompt,PointInputOptions? p=null,
SelectionInputOptions? s=null,ValueInputOptions? v=null)
=>new(d.Id,d.Revision,Guid.NewGuid().ToString("D"),kind,prompt,p,s,v);
public static Task<CadInputResult> GetPointAsync(this ICadInputApi api, DocumentInfo document, string prompt,
Point3? basePoint=null, bool rubberBand=true, CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"point",prompt,new(basePoint,rubberBand)),cancellationToken);
public static Task<CadInputResult> GetCornerAsync(this ICadInputApi api,DocumentInfo document,string prompt,
Point3 basePoint,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"corner",prompt,new(basePoint)),cancellationToken);
public static Task<CadInputResult> GetDistanceAsync(this ICadInputApi api,DocumentInfo document,string prompt,
Point3 basePoint,ValueInputOptions? options=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"distance",prompt,new(basePoint),v:options),cancellationToken);
public static Task<CadInputResult> GetAngleAsync(this ICadInputApi api,DocumentInfo document,string prompt,
Point3 basePoint,ValueInputOptions? options=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"angle",prompt,new(basePoint),v:options),cancellationToken);
public static Task<CadInputResult> GetIntegerAsync(this ICadInputApi api,DocumentInfo document,string prompt,
ValueInputOptions? options=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"integer",prompt,v:options),cancellationToken);
public static Task<CadInputResult> GetDoubleAsync(this ICadInputApi api,DocumentInfo document,string prompt,
ValueInputOptions? options=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"double",prompt,v:options),cancellationToken);
public static Task<CadInputResult> GetStringAsync(this ICadInputApi api,DocumentInfo document,string prompt,
ValueInputOptions? options=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"string",prompt,v:options),cancellationToken);
public static Task<CadInputResult> GetKeywordsAsync(this ICadInputApi api,DocumentInfo document,string prompt,
string[] keywords,string? defaultKeyword=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"keyword",prompt,v:new(DefaultText:defaultKeyword,Keywords:keywords)),cancellationToken);
public static Task<CadInputResult> GetEntityAsync(this ICadInputApi api,DocumentInfo document,string prompt,
SelectionFilter? filter=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"entity",prompt,s:new(filter,MaximumCount:1)),cancellationToken);
public static Task<CadInputResult> GetSelectionAsync(this ICadInputApi api,DocumentInfo document,string prompt,
SelectionInputOptions? options=null,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"selection",prompt,s:options),cancellationToken);
public static Task<CadInputResult> GetSubentityAsync(this ICadInputApi api,DocumentInfo document,string prompt,
string kind,CancellationToken cancellationToken=default)
=>api.PromptAsync(Request(document,"entity",prompt,s:new(MaximumCount:1,Target:kind)),cancellationToken);
/// <summary>Cursor-driven preview, analogous to a simple drawing jig. The callback returns transient definitions
/// and must not edit CAD. Commit drawing geometry separately after the user accepts the input.</summary>
public static async Task<CadInputResult> DragAsync(this ICadInputApi api,CadInputRequest request,
Func<Point3,InputPreviewRequest> preview,CancellationToken cancellationToken=default)
{
ArgumentNullException.ThrowIfNull(preview);
if(request.Kind is not ("point" or "corner" or "distance" or "angle")) throw new ArgumentException("Drag requires point-based input.");
try
{
cancellationToken.ThrowIfCancellationRequested();
var result=await api.StartInputAsync(request,cancellationToken); Point3? last=null;
while(result.State=="waiting")
{
if(result.CursorPoint is {} p && p!=last)
{
var shapes=preview(p) with {InputId=result.InputId};
result=await api.UpdateInputPreviewAsync(shapes,cancellationToken);last=p;
if(result.State!="waiting")break;
}
await Task.Delay(30,cancellationToken);
result=await api.GetInputAsync(result.InputId,cancellationToken);
}
return result;
}
catch
{
try{await api.CancelInputAsync(request.OperationId,CancellationToken.None);}catch(CadApiException){}
throw;
}
}
}
InteractiveCommandInfo
public sealed record InteractiveCommandInfo(string Id,string Group,bool Available,string? UnavailableReason=null)
{
public string? UnavailableCode { get; init; }
public LicenseRestriction? LicenseRestriction { get; init; }
}InteractiveCommandRequest
public sealed record InteractiveCommandRequest(string DocumentId,long ExpectedRevision,string OperationId,string CommandId);
InteractiveCommandResult
public sealed record InteractiveCommandResult(string CommandId,string State,string Message);
ソース全体: InteractionContracts.cs
namespace JDesignCAD.Api;
/// <summary>Interactive commands are distinct from automated operations: the user completes selection/dialogs in CAD.</summary>
public interface ICadInteractionApi : ICadWorkspaceApi
{
Task<InteractiveCommandInfo[]> GetInteractiveCommandsAsync(CancellationToken cancellationToken=default);
Task<InteractiveCommandResult> LaunchInteractiveCommandAsync(InteractiveCommandRequest request,CancellationToken cancellationToken=default);
}
public sealed record InteractiveCommandInfo(string Id,string Group,bool Available,string? UnavailableReason=null)
{
public string? UnavailableCode { get; init; }
public LicenseRestriction? LicenseRestriction { get; init; }
}
public sealed record InteractiveCommandRequest(string DocumentId,long ExpectedRevision,string OperationId,string CommandId);
/// <summary>State queued only acknowledges dispatch. It never means creation, saving or printing completed.</summary>
public sealed record InteractiveCommandResult(string CommandId,string State,string Message);
InterferenceParameters
public sealed record InterferenceParameters(string[] EntityIds, double Tolerance = 0.000001, InterferencePair[]? Pairs = null);
InterferencePair
public sealed record InterferencePair(string FirstEntityId, string SecondEntityId);
ソース全体: InterferenceContracts.cs
namespace JDesignCAD.Api; /// <summary>solid.interference: checks 2..100 explicit solids in a read-only worker. /// Result sections: summary and pairs. Each pair includes original entity IDs, status /// (clear/contact/interference/failed), commonVolume (mm³), contactFaceCount and diagnostics. /// A failed pair is unknown, never evidence of clearance. This checks the current static placement, not motion.</summary> public sealed record InterferenceParameters(string[] EntityIds, double Tolerance = 0.000001, InterferencePair[]? Pairs = null); /// <summary>Optional explicit pairs, both IDs must be in EntityIds. Omit Pairs to check every combination.</summary> public sealed record InterferencePair(string FirstEntityId, string SecondEntityId);
StartOperationRequest
public sealed record StartOperationRequest(OperationRequest Request, int TimeoutSeconds = 120);
JobInfo
public sealed record JobInfo(string Id, string DocumentId, long SourceRevision, string Operation, string State,
string Stage, int ResultCount = 0, string? ErrorCode = null, string? Message = null);CommitJobRequest
public sealed record CommitJobRequest(string DocumentId, long ExpectedRevision, string OperationId, string JobId);
PrimitiveParameters
public sealed record PrimitiveParameters(string Kind, Point3 Origin, Point3? Size = null, Point3? Axis = null,
double Radius = 10, double SecondRadius = 5);ExtrudeParameters
public sealed record ExtrudeParameters(string[] EntityIds, Point3 Direction, bool Solid = true, bool DeleteSources = false);
RevolveParameters
public sealed record RevolveParameters(string EntityId, Point3 Origin, Point3 Axis, double AngleDegrees = 360, bool DeleteSource = false);
SweepParameters
public sealed record SweepParameters(string ProfileId, string PathId, bool DeleteSources = false);
LoftParameters
public sealed record LoftParameters(string[] ProfileIds, bool Solid = true, string? GuideId = null, bool DeleteSources = false);
BooleanParameters
public sealed record BooleanParameters(string[] EntityIds, string Kind);
FilletParameters
public sealed record FilletParameters(string EntityId, SubobjectRef[] Edges, double Radius);
ResizeFilletParameters
public sealed record ResizeFilletParameters(string EntityId, SubobjectRef[] Faces, double Radius);
ChamferParameters
public sealed record ChamferParameters(string EntityId, SubobjectRef ReferenceFace, SubobjectRef[] Edges, double Distance1, double Distance2);
FaceOffsetParameters
public sealed record FaceOffsetParameters(string EntityId, SubobjectRef[] Faces, double Distance);
RemoveFacesParameters
public sealed record RemoveFacesParameters(string EntityId, SubobjectRef[] Faces);
SurfaceTrimParameters
public sealed record SurfaceTrimParameters(SubobjectRef Target, SubobjectRef Cutter);
SewParameters
public sealed record SewParameters(string[] EntityIds);
CreateFaceParameters
public sealed record CreateFaceParameters(string EntityId, bool DeleteSource = false);
SheetRules
public sealed record SheetRules(double Thickness = 1, double Radius = 1, double KFactor = .4,
int ReliefType = 0, double ReliefWidth = 1, double ReliefDepth = 2);SheetPlateParameters
public sealed record SheetPlateParameters(string ProfileId, SheetRules Rules, int ThicknessSide = 0);
SheetBodyParameters
public sealed record SheetBodyParameters(string EntityId);
SheetRulesParameters
public sealed record SheetRulesParameters(string EntityId, SheetRules Rules);
SheetRecognizeParameters
public sealed record SheetRecognizeParameters(string EntityId, SubobjectRef BaseFace, SheetRules Rules, bool DetectThickness = true);
SheetFlangeParameters
public sealed record SheetFlangeParameters(string EntityId, SubobjectRef[] Edges, SheetRules Rules,
double Length, double AngleDegrees = 90, double Gap = .1, bool AutoCorner = true,
int PositionReference = 0, int LengthReference = 0, double? StartDistance = null, double? EndDistance = null);SheetBendParameters
public sealed record SheetBendParameters(string EntityId, string LineId, SubobjectRef FixedFace, SheetRules Rules,
double AngleDegrees = 90, int PositionReference = 0);SheetEditBendParameters
public sealed record SheetEditBendParameters(string EntityId, SubobjectRef BendFace, double AngleDegrees,
double Radius, double Length, int LengthReference = 0);SheetHemParameters
public sealed record SheetHemParameters(string EntityId, SubobjectRef[] Edges, SheetRules Rules, double Length, double Gap);
SheetJogParameters
public sealed record SheetJogParameters(string EntityId, SubobjectRef Edge, SheetRules Rules, double Height, double Length, double AngleDegrees = 90);
SheetStep
public sealed record SheetStep(double Length, double AngleDegrees, double Radius);
SheetContourParameters
public sealed record SheetContourParameters(string EntityId, SubobjectRef Edge, SheetRules Rules, SheetStep[] Steps);
SheetReliefParameters
public sealed record SheetReliefParameters(string EntityId, SubobjectRef[] Edges, double Width, double Depth, bool Round = false, bool Remove = false);
SheetRipParameters
public sealed record SheetRipParameters(string EntityId, SubobjectRef[] Edges, double Gap, int Side = 2);
SheetCornerParameters
public sealed record SheetCornerParameters(string EntityId, SubobjectRef[] Faces, double Gap, int Kind = 0);
SheetFlatPatternParameters
public sealed record SheetFlatPatternParameters(string EntityId, Point3 Placement, bool BendLines = true, bool Annotations = true, bool BendTable = false);
SheetLoftDimensions
public sealed record SheetLoftDimensions(int Kind = 1, int FormingMode = 1, double BottomRadius = 30, double TopRadius = 20,
double Height = 50, double BottomWidth = 80, double BottomDepth = 60, double TopWidth = 50, double TopDepth = 40,
double CornerRadius = 5, double TopCornerRadius = 5, double OffsetX = 0, double OffsetY = 0,
double SeamGap = 1, int Segments = 32, int SeamMode = 0, double SeamAngle = 0, double Angle = 350,
Point3? Origin = null);SheetLoftParameters
public sealed record SheetLoftParameters(SheetRules Rules, SheetLoftDimensions Dimensions, string? EntityId = null);
SheetFormDimensions
public sealed record SheetFormDimensions(int Kind, double Diameter = 6, double Height = 4, double RootRadius = 1,
double CrownRadius = 2, double Span = 10, double PilotDiameter = 4, bool Suppressed = false)
{
// Additive property preserves the existing positional constructor and DLL ABI.
public double CornerRadius { get; init; } = 1;
public double BridgeHoleDiameter { get; init; }
/// <summary>Rectangular draw flank angle to the original sheet plane, degrees. Default 90 preserves existing forms.</summary>
public double WallAngleDegrees { get; init; } = 90;
}SheetFormParameters
public sealed record SheetFormParameters(string EntityId, SubobjectRef Face, Point3 Center, SheetFormDimensions Dimensions,
double RotationDegrees = 0, bool Reverse = false);SheetEditFormParameters
public sealed record SheetEditFormParameters(string EntityId, string FormId, SheetFormDimensions Dimensions, bool Delete = false);
SheetManageBendParameters
public sealed record SheetManageBendParameters(string EntityId, int BendIndex, int Operation, int ParentIndex = -1);
ソース全体: JobContracts.cs
namespace JDesignCAD.Api;
/// <summary>Heavy computations run in an owned worker process. A ready result is committed explicitly as one Undo step.</summary>
public interface ICadJobApi : ICadAutomationApi
{
Task<JobInfo> StartOperationAsync(StartOperationRequest request, CancellationToken cancellationToken = default);
Task<JobInfo> GetJobAsync(string jobId, CancellationToken cancellationToken = default);
Task<JobInfo> CancelJobAsync(string jobId, CancellationToken cancellationToken = default);
Task<EditResult> CommitJobAsync(CommitJobRequest request, CancellationToken cancellationToken = default);
}
public sealed record StartOperationRequest(OperationRequest Request, int TimeoutSeconds = 120);
/// <summary>States: running, ready, committed, completed (read-only result), cancelled, failed. Cancellation of a ready result discards it.</summary>
public sealed record JobInfo(string Id, string DocumentId, long SourceRevision, string Operation, string State,
string Stage, int ResultCount = 0, string? ErrorCode = null, string? Message = null);
/// <summary>Commit is rejected if the drawing changed since StartOperation, even if a newer ExpectedRevision is supplied.</summary>
public sealed record CommitJobRequest(string DocumentId, long ExpectedRevision, string OperationId, string JobId);
/// <summary>Primitive kind: box, cylinder, cone, sphere, torus. Size gives box dimensions; axis gives direction and height.
/// Radius is cylinder/sphere/base-cone/major-torus radius; SecondRadius is cone top/minor-torus radius.</summary>
public sealed record PrimitiveParameters(string Kind, Point3 Origin, Point3? Size = null, Point3? Axis = null,
double Radius = 10, double SecondRadius = 5);
public sealed record ExtrudeParameters(string[] EntityIds, Point3 Direction, bool Solid = true, bool DeleteSources = false);
public sealed record RevolveParameters(string EntityId, Point3 Origin, Point3 Axis, double AngleDegrees = 360, bool DeleteSource = false);
public sealed record SweepParameters(string ProfileId, string PathId, bool DeleteSources = false);
public sealed record LoftParameters(string[] ProfileIds, bool Solid = true, string? GuideId = null, bool DeleteSources = false);
/// <summary>Kind: union, subtract, intersect. The first source is the base for subtraction. All source bodies are consumed.</summary>
public sealed record BooleanParameters(string[] EntityIds, string Kind);
public sealed record FilletParameters(string EntityId, SubobjectRef[] Edges, double Radius);
public sealed record ResizeFilletParameters(string EntityId, SubobjectRef[] Faces, double Radius);
public sealed record ChamferParameters(string EntityId, SubobjectRef ReferenceFace, SubobjectRef[] Edges, double Distance1, double Distance2);
public sealed record FaceOffsetParameters(string EntityId, SubobjectRef[] Faces, double Distance);
public sealed record RemoveFacesParameters(string EntityId, SubobjectRef[] Faces);
public sealed record SurfaceTrimParameters(SubobjectRef Target, SubobjectRef Cutter);
public sealed record SewParameters(string[] EntityIds);
public sealed record CreateFaceParameters(string EntityId, bool DeleteSource = false);
public sealed record SheetRules(double Thickness = 1, double Radius = 1, double KFactor = .4,
int ReliefType = 0, double ReliefWidth = 1, double ReliefDepth = 2);
public sealed record SheetPlateParameters(string ProfileId, SheetRules Rules, int ThicknessSide = 0);
public sealed record SheetBodyParameters(string EntityId);
public sealed record SheetRulesParameters(string EntityId, SheetRules Rules);
public sealed record SheetRecognizeParameters(string EntityId, SubobjectRef BaseFace, SheetRules Rules, bool DetectThickness = true);
public sealed record SheetFlangeParameters(string EntityId, SubobjectRef[] Edges, SheetRules Rules,
double Length, double AngleDegrees = 90, double Gap = .1, bool AutoCorner = true,
int PositionReference = 0, int LengthReference = 0, double? StartDistance = null, double? EndDistance = null);
public sealed record SheetBendParameters(string EntityId, string LineId, SubobjectRef FixedFace, SheetRules Rules,
double AngleDegrees = 90, int PositionReference = 0);
public sealed record SheetEditBendParameters(string EntityId, SubobjectRef BendFace, double AngleDegrees,
double Radius, double Length, int LengthReference = 0);
public sealed record SheetHemParameters(string EntityId, SubobjectRef[] Edges, SheetRules Rules, double Length, double Gap);
public sealed record SheetJogParameters(string EntityId, SubobjectRef Edge, SheetRules Rules, double Height, double Length, double AngleDegrees = 90);
public sealed record SheetStep(double Length, double AngleDegrees, double Radius);
public sealed record SheetContourParameters(string EntityId, SubobjectRef Edge, SheetRules Rules, SheetStep[] Steps);
public sealed record SheetReliefParameters(string EntityId, SubobjectRef[] Edges, double Width, double Depth, bool Round = false, bool Remove = false);
public sealed record SheetRipParameters(string EntityId, SubobjectRef[] Edges, double Gap, int Side = 2);
public sealed record SheetCornerParameters(string EntityId, SubobjectRef[] Faces, double Gap, int Kind = 0);
public sealed record SheetFlatPatternParameters(string EntityId, Point3 Placement, bool BendLines = true, bool Annotations = true, bool BendTable = false);
/// <summary>Kind: roll=0, round-round=1, rectangle-round=2, rectangle-rectangle=3. FormingMode: faceted=0, smooth=1.
/// SeamMode: automatic=0, specified=1. Dimensions are mm, seam/roll angles are degrees.</summary>
public sealed record SheetLoftDimensions(int Kind = 1, int FormingMode = 1, double BottomRadius = 30, double TopRadius = 20,
double Height = 50, double BottomWidth = 80, double BottomDepth = 60, double TopWidth = 50, double TopDepth = 40,
double CornerRadius = 5, double TopCornerRadius = 5, double OffsetX = 0, double OffsetY = 0,
double SeamGap = 1, int Segments = 32, int SeamMode = 0, double SeamAngle = 0, double Angle = 350,
Point3? Origin = null);
public sealed record SheetLoftParameters(SheetRules Rules, SheetLoftDimensions Dimensions, string? EntityId = null);
/// <summary>Kind: burring=0, dimple=1, emboss=2, bead=3, louver=4,
/// round draw=5, rectangular draw=6, bridge=7. Louver Diameter is flat roof depth;
/// rectangular draw Diameter/Span are flat bottom width/length.</summary>
public sealed record SheetFormDimensions(int Kind, double Diameter = 6, double Height = 4, double RootRadius = 1,
double CrownRadius = 2, double Span = 10, double PilotDiameter = 4, bool Suppressed = false)
{
// Additive property preserves the existing positional constructor and DLL ABI.
public double CornerRadius { get; init; } = 1;
public double BridgeHoleDiameter { get; init; }
/// <summary>Rectangular draw flank angle to the original sheet plane, degrees. Default 90 preserves existing forms.</summary>
public double WallAngleDegrees { get; init; } = 90;
}
public sealed record SheetFormParameters(string EntityId, SubobjectRef Face, Point3 Center, SheetFormDimensions Dimensions,
double RotationDegrees = 0, bool Reverse = false);
public sealed record SheetEditFormParameters(string EntityId, string FormId, SheetFormDimensions Dimensions, bool Delete = false);
public sealed record SheetManageBendParameters(string EntityId, int BendIndex, int Operation, int ParentIndex = -1);
LayoutRectangle
public sealed record LayoutRectangle(double Left,double Right,double Bottom,double Top);
LayoutViewParameters
public sealed record LayoutViewParameters(Point3 Direction,Point3 Up,Point3 ModelOrigin,Point3 PaperOrigin,
double Scale,LayoutRectangle Clip,string[] VisibleLayers,string Display="hiddenLines");LayoutDimensionParameters
public sealed record LayoutDimensionParameters(DimensionParameters Dimension,double ValueScale=1,double TextHeight=2.5);
LayoutCreateParameters
public sealed record LayoutCreateParameters(string Name,double Width,double Height,LayoutViewParameters[] Views,
GeometryDefinition[] Objects,LayoutDimensionParameters[] Dimensions);LayoutActivateParameters
public sealed record LayoutActivateParameters(string Name);
LayoutLeaderParameters
public sealed record LayoutLeaderParameters(string Text,Point3 Anchor,Point3 Landing,double TextHeight=3,
string Font="Yu Gothic",Point3[]? Elbows=null,CadColor? Color=null);LayoutAnnotationsParameters
public sealed record LayoutAnnotationsParameters(string Name,int[] RemoveIndices,LayoutLeaderParameters[] Leaders);
DrawingCaptureParameters
public sealed record DrawingCaptureParameters(string FilePath,string? LayoutName=null,int Width=1600,int Height=1100,bool Overwrite=false);
ソース全体: LayoutContracts.cs
namespace JDesignCAD.Api;
/// <summary>Paper-space coordinates and dimensions are millimetres on the sheet.</summary>
public sealed record LayoutRectangle(double Left,double Right,double Bottom,double Top);
public sealed record LayoutViewParameters(Point3 Direction,Point3 Up,Point3 ModelOrigin,Point3 PaperOrigin,
double Scale,LayoutRectangle Clip,string[] VisibleLayers,string Display="hiddenLines");
public sealed record LayoutDimensionParameters(DimensionParameters Dimension,double ValueScale=1,double TextHeight=2.5);
public sealed record LayoutCreateParameters(string Name,double Width,double Height,LayoutViewParameters[] Views,
GeometryDefinition[] Objects,LayoutDimensionParameters[] Dimensions);
public sealed record LayoutActivateParameters(string Name);
/// <summary>One native text leader. Anchor is the arrow tip, Landing starts the horizontal text shelf.
/// Elbows are optional intermediate paper-space points. All sizes are printed millimetres.</summary>
public sealed record LayoutLeaderParameters(string Text,Point3 Anchor,Point3 Landing,double TextHeight=3,
string Font="Yu Gothic",Point3[]? Elbows=null,CadColor? Color=null);
/// <summary>Update only paper annotations in an existing layout, as one Undo operation.
/// RemoveIndices come from query kind layoutAnnotations at the same document revision. [] creates leaders without removal.</summary>
public sealed record LayoutAnnotationsParameters(string Name,int[] RemoveIndices,LayoutLeaderParameters[] Leaders);
/// <summary>Export a rendered drawing preview without changing geometry. Null layoutName captures the model view.</summary>
public sealed record DrawingCaptureParameters(string FilePath,string? LayoutName=null,int Width=1600,int Height=1100,bool Overwrite=false);
EntityQuery
public sealed record EntityQuery(string DocumentId, long ExpectedRevision, int Offset = 0, int Limit = 256);
EntityPage
public sealed record EntityPage(DocumentInfo Document, EntityInfo[] Entities, int Total, int Offset);
EntityDetailsRequest
public sealed record EntityDetailsRequest(string DocumentId, long ExpectedRevision, string[] EntityIds);
EntityDetailsResult
public sealed record EntityDetailsResult(DocumentInfo Document, EntityDetail[] Entities);
EntityDetail
public sealed record EntityDetail(EntityInfo Entity, bool LayerLocked, string GeometryStatus,
LineDefinition? Line = null, CircleDefinition? Circle = null, ArcDefinition? Arc = null, PolylineDefinition? Polyline = null);PolylineDefinition
public sealed record PolylineDefinition(Point3[] Vertices, bool Closed = false);
ArcDefinition
public sealed record ArcDefinition(Point3 Center, Point3 Start, Point3 Normal, double SweepDegrees);
CreateCurvesRequest
public sealed record CreateCurvesRequest(string DocumentId, long ExpectedRevision, string OperationId,
PolylineDefinition[] Polylines, ArcDefinition[] Arcs, bool SelectCreated = true);EntityEditRequest
public sealed record EntityEditRequest(string DocumentId, long ExpectedRevision, string OperationId, string[] EntityIds);
TranslateEntitiesRequest
public sealed record TranslateEntitiesRequest(string DocumentId, long ExpectedRevision, string OperationId,
string[] EntityIds, Point3 Displacement, bool Copy = false, bool SelectResult = true);ソース全体: ModelContracts.cs
namespace JDesignCAD.Api;
/// <summary>API v1.1 additions. Existing ICadApi DLLs remain binary compatible.
/// Cast IAddinContext.Api to this interface to discover the additional capability.</summary>
public interface ICadModelApi : ICadApi
{
Task<EntityPage> GetEntitiesAsync(EntityQuery request, CancellationToken cancellationToken = default);
Task<EntityDetailsResult> GetEntityDetailsAsync(EntityDetailsRequest request, CancellationToken cancellationToken = default);
Task<EditResult> SetSelectionAsync(EntityEditRequest request, CancellationToken cancellationToken = default);
Task<EditResult> CreateCurvesAsync(CreateCurvesRequest request, CancellationToken cancellationToken = default);
Task<EditResult> TranslateEntitiesAsync(TranslateEntitiesRequest request, CancellationToken cancellationToken = default);
Task<EditResult> DeleteEntitiesAsync(EntityEditRequest request, CancellationToken cancellationToken = default);
}
/// <summary>Top-level model objects in drawing order; limit 1..1000. Keep the same revision while paging.</summary>
public sealed record EntityQuery(string DocumentId, long ExpectedRevision, int Offset = 0, int Limit = 256);
public sealed record EntityPage(DocumentInfo Document, EntityInfo[] Entities, int Total, int Offset);
/// <summary>At most 100 top-level entity IDs per call.</summary>
public sealed record EntityDetailsRequest(string DocumentId, long ExpectedRevision, string[] EntityIds);
public sealed record EntityDetailsResult(DocumentInfo Document, EntityDetail[] Entities);
/// <summary>GeometryStatus is available, unsupported, or too_large (over the 4096-point response budget).
/// Unsupported objects still return their type, layer, bounds and lock state.</summary>
public sealed record EntityDetail(EntityInfo Entity, bool LayerLocked, string GeometryStatus,
LineDefinition? Line = null, CircleDefinition? Circle = null, ArcDefinition? Arc = null, PolylineDefinition? Polyline = null);
/// <summary>Linear 3D polyline. Closed outlines use at least 3 vertices; do not repeat the first vertex at the end.</summary>
public sealed record PolylineDefinition(Point3[] Vertices, bool Closed = false);
/// <summary>Circular arc from Start around Center. Right-hand signed sweep about Normal, in degrees;
/// 0 < abs(sweep) < 360. Start-Center must be perpendicular to Normal.</summary>
public sealed record ArcDefinition(Point3 Center, Point3 Start, Point3 Normal, double SweepDegrees);
/// <summary>One Undo batch of 1..1000 curves, at most 4096 polyline vertices in total.</summary>
public sealed record CreateCurvesRequest(string DocumentId, long ExpectedRevision, string OperationId,
PolylineDefinition[] Polylines, ArcDefinition[] Arcs, bool SelectCreated = true);
/// <summary>IDs are explicit, unique top-level objects. Selection replacement allows [] to clear;
/// deletion requires 1..1000 IDs. Selection is transient and does not add an Undo step.</summary>
public sealed record EntityEditRequest(string DocumentId, long ExpectedRevision, string OperationId, string[] EntityIds);
/// <summary>Translate 1..1000 top-level objects in WCS mm. Copy preserves the originals and their attributes.
/// The entire edit is one Undo step. Zero displacement is allowed for Copy only.</summary>
public sealed record TranslateEntitiesRequest(string DocumentId, long ExpectedRevision, string OperationId,
string[] EntityIds, Point3 Displacement, bool Copy = false, bool SelectResult = true);
OpenDocumentParameters
public sealed record OpenDocumentParameters(string FilePath);
ActivateViewParameters
public sealed record ActivateViewParameters(string Kind, string? Name = null, bool ZoomToFit = false);
ソース全体: NavigationContracts.cs
namespace JDesignCAD.Api; /// <summary>Open an existing native JDC in this CAD window. No Undo entry; the current /// drawing must be saved. With no drawing open, use documentId="", expectedRevision=0. /// Retry the identical operationId after a transport timeout; it never opens twice.</summary> public sealed record OpenDocumentParameters(string FilePath); /// <summary>Kind is model or layout. Name is required for layouts; null model name /// selects the current model's first view. Query kind=views supplies exact names. /// Keeps the view's saved camera/zoom unless ZoomToFit is explicitly requested.</summary> public sealed record ActivateViewParameters(string Kind, string? Name = null, bool ZoomToFit = false);
ScrewParameters
public sealed record ScrewParameters(string ProfileId, Point3 Origin, Point3 Axis,
double Pitch, double Turns, bool RightHanded = true, bool DeleteSource = false);ソース全体: ScrewContracts.cs
namespace JDesignCAD.Api;
/// <summary>
/// geometry.screw: rotate a closed planar profile while translating it along an axis.
/// Origin and Axis must lie in the profile plane. Pitch is the positive axial advance
/// per turn in WCS millimetres; Turns may be fractional. Both handednesses advance
/// in the positive Axis direction. The profile must stay on one side of the axis
/// and its axial span must be less than Pitch (adjacent turns must not overlap).
/// Returns one solid with analytic helical surfaces, suitable for Boolean thread tools.
/// </summary>
public sealed record ScrewParameters(string ProfileId, Point3 Origin, Point3 Axis,
double Pitch, double Turns, bool RightHanded = true, bool DeleteSource = false);
SurfaceLabelParameters
public sealed record SurfaceLabelParameters(SubobjectRef Face, Point3 Center, double Width=30, double Height=10,
double RotationDegrees=0, string? Text=null, string? ImagePath=null, string FontName="Yu Gothic",
string Color="000000", string Mode="add", string? LabelId=null);ソース全体: SurfaceLabelContracts.cs
namespace JDesignCAD.Api;
/// <summary>Appearance-only decal on one face. WCS center, mm width/height, degrees counterclockwise from surface U.
/// Provide text or imagePath exclusively. mode=replace/remove requires labelId from query kind=surfaceLabels.
/// Curved sizes are measured in the tangent metric at the center; freeform/spherical labels may distort.
/// The label clips to face edges/holes, wraps periodic seams, follows transforms, and embeds its pixels in JDC.
/// Raster labels are not engraved geometry and are not included in STEP/STL.</summary>
public sealed record SurfaceLabelParameters(SubobjectRef Face, Point3 Center, double Width=30, double Height=10,
double RotationDegrees=0, string? Text=null, string? ImagePath=null, string FontName="Yu Gothic",
string Color="000000", string Mode="add", string? LabelId=null);
TextUpdate
public sealed record TextUpdate(string EntityId, string Content);
UpdateTextParameters
public sealed record UpdateTextParameters(TextUpdate[] Updates);
ソース全体: TextContracts.cs
namespace JDesignCAD.Api; /// <summary>Change only the content of a top-level Text. Preserves font, size, alignment, /// orientation, position, attributes and entity ID. Block attribute definitions are excluded. /// Content must contain 1..32768 characters.</summary> public sealed record TextUpdate(string EntityId, string Content); /// <summary>text.update: 1..100 distinct texts, validated before editing, in one Undo step.</summary> public sealed record UpdateTextParameters(TextUpdate[] Updates);
QueryRequest
public sealed record QueryRequest(string DocumentId,long ExpectedRevision,string Kind,string[] EntityIds);
QueryResult
public sealed record QueryResult(DocumentInfo Document,JsonElement Data);
JobDataRequest
public sealed record JobDataRequest(string JobId,string Section="summary",int Offset=0,int Limit=128);
JobDataPage
public sealed record JobDataPage(JobInfo Job,string Section,JsonElement Data,int Total,int Offset);
BlockCreateParameters
public sealed record BlockCreateParameters(string[] EntityIds,string Name,Point3 BasePoint);
BlockInsertParameters
public sealed record BlockInsertParameters(string Name,Point3 Position,Point3? Scale=null,double RotationDegrees=0,Point3? Normal=null);
BlockValue
public sealed record BlockValue(string Name,string Value);
BlockAttributesParameters
public sealed record BlockAttributesParameters(string EntityId,BlockValue[] Values);
BlockDynamicParameters
public sealed record BlockDynamicParameters(string EntityId,string Key,string Value);
ExplodeParameters
public sealed record ExplodeParameters(string[] EntityIds);
CurveJoinParameters
public sealed record CurveJoinParameters(string[] EntityIds,double Tolerance=0.000001);
CurveSplitParameters
public sealed record CurveSplitParameters(string EntityId,double Parameter);
CurveOffsetParameters
public sealed record CurveOffsetParameters(string EntityId,Point3 PlaneNormal,double Distance,double Tolerance=0.001);
ShellParameters
public sealed record ShellParameters(string EntityId,SubobjectRef[] OpenFaces,double Thickness);
FaceMoveParameters
public sealed record FaceMoveParameters(string EntityId,SubobjectRef[] Faces,Point3 Displacement,bool MoveConnected=false);
FaceRotateParameters
public sealed record FaceRotateParameters(string EntityId,SubobjectRef[] Faces,Point3 Origin,Point3 Axis,double AngleDegrees,bool MoveConnected=false);
FaceRadiusParameters
public sealed record FaceRadiusParameters(string EntityId,SubobjectRef[] Faces,double Radius);
MeasureParameters
public sealed record MeasureParameters(string[] EntityIds,double Tolerance=0.001);
DimensionParameters
public sealed record DimensionParameters(string Kind,Point3[] Points,Point3 TextPosition,Point3 Normal,Point3 Direction,double Radius=0,string? Style=null);
HatchParameters
public sealed record HatchParameters(string ProfileId,string? Style=null);
ソース全体: WorkspaceContracts.cs
using System.Text.Json;
namespace JDesignCAD.Api;
/// <summary>v1.2 document inspection, blocks and background result data.</summary>
public interface ICadWorkspaceApi : ICadJobApi
{
Task<QueryResult> QueryAsync(QueryRequest request,CancellationToken cancellationToken=default);
Task<JobDataPage> GetJobDataAsync(JobDataRequest request,CancellationToken cancellationToken=default);
}
/// <summary>Kind: geometry, blocks, sheet, sheetDefaults, views, layouts, layoutViews, layoutAnnotations, sectionPlanes, animations, surfaceLabels, styles. IDs: 1..100 for geometry/sheet, [] otherwise.</summary>
public sealed record QueryRequest(string DocumentId,long ExpectedRevision,string Kind,string[] EntityIds);
public sealed record QueryResult(DocumentInfo Document,JsonElement Data);
/// <summary>Read a named array from a completed data job. Offset >= 0, limit 1..256.</summary>
public sealed record JobDataRequest(string JobId,string Section="summary",int Offset=0,int Limit=128);
public sealed record JobDataPage(JobInfo Job,string Section,JsonElement Data,int Total,int Offset);
public sealed record BlockCreateParameters(string[] EntityIds,string Name,Point3 BasePoint);
public sealed record BlockInsertParameters(string Name,Point3 Position,Point3? Scale=null,double RotationDegrees=0,Point3? Normal=null);
public sealed record BlockValue(string Name,string Value);
public sealed record BlockAttributesParameters(string EntityId,BlockValue[] Values);
public sealed record BlockDynamicParameters(string EntityId,string Key,string Value);
public sealed record ExplodeParameters(string[] EntityIds);
public sealed record CurveJoinParameters(string[] EntityIds,double Tolerance=0.000001);
public sealed record CurveSplitParameters(string EntityId,double Parameter);
public sealed record CurveOffsetParameters(string EntityId,Point3 PlaneNormal,double Distance,double Tolerance=0.001);
public sealed record ShellParameters(string EntityId,SubobjectRef[] OpenFaces,double Thickness);
public sealed record FaceMoveParameters(string EntityId,SubobjectRef[] Faces,Point3 Displacement,bool MoveConnected=false);
public sealed record FaceRotateParameters(string EntityId,SubobjectRef[] Faces,Point3 Origin,Point3 Axis,double AngleDegrees,bool MoveConnected=false);
public sealed record FaceRadiusParameters(string EntityId,SubobjectRef[] Faces,double Radius);
public sealed record MeasureParameters(string[] EntityIds,double Tolerance=0.001);
public sealed record DimensionParameters(string Kind,Point3[] Points,Point3 TextPosition,Point3 Normal,Point3 Direction,double Radius=0,string? Style=null);
public sealed record HatchParameters(string ProfileId,string? Style=null);