• このフォーラムは、www.cad3d.it/forum1 - イタリアのデザインコミュニティの機械翻訳です。いくつかの用語は正しく翻訳されていません。

ilogicと変更からフラットモデルdwgをエクスポート

  • Thread starter Thread starter CaesarXXI
  • Start date Start date

CaesarXXI

Guest
全てに

私はilogicルールの助けを必要とし、私は専門家ではありませんし、このコードは、ネット上で撮影した接着剤のコピーを作成し、少し直感を起こすことによって作られています。

最終結果は「環境」シートでファイルを保存する際に、特定のフォルダ(ルールで作成される)内のdwgにフラットモデルを自動保存し、「環境」シートでファイルを保存するときに、コマンドと一緒に「環境」で実行します。 モディフカ (ファイルを再オープンすることなく)

私はシートファイル内の3つのルールを作成し、最初の「マスター」はイベントトリガーでファイルを保存した後に活性化します。 このルールは、彼らが「環境」シートにいるかどうかを確認し、そしてその後、dwgをエクスポートするために結合ルールをロードする必要があります。 おそらくあなたは単一のルールですべてを行うことができますが、私の試みの間に、これは私の期待に最も近い結果です。

すべてがうまく機能し、私はシートでそれを望むが、私は軸線で変更しようとすると、私は間違いを取得し、新しい幾何学を保存しません。

エラーメッセージは次のようになります。
Errore_01.JPGErrore_01_info.JPGマスターの規則:
Code:
マスター
odoc をドキュメント = thisdoc.document
odoc.documenttype = inventor.documenttypeenum.kpartdocumentobject と odoc.subtype = "{9c464203-9bae-11d3-8bad-0060b0ce6bb4}" の場合、
このアプリケーションのtypeofの場合。 Activeeditobjectはスケッチです
messagebox.show("部分ファイルでアクティブなスケッチを持っている"、"スケッチを停止")
その他
ilogicvb.runrule("salva_modellopiatto")
端 もし
'アセンブリファイル
odoc.documenttype = inventor.documenttypeenum.kassemblydocumentobject それから
odoc.componentdefinition.isiassemblyfactory なら、
messagebox.show("this is iassemblyfactory"、"i will stop")
フィードバック
odoc.componentdefinition.isiassemblymember なら、
messagebox.show("this is iassemblymember", "i will stop")
フィードバック
端 もし
このアプリケーションのtypeofの場合。 Activeeditobjectはスケッチです
messagebox.show("アセンブリファイルでアクティブにスケッチを持っている"、"スケッチを停止")
その他
ilogicvb.runrule("salva_modellopiatto_01")
端 もし
端 もし
lamieraごとのregola:
Code:
'salva_modellopiatto さん
rusure = メッセージボックス.show( _)
"salva dwg dal modello piatto." ツイート
・vblf & "premere Yes per continuare" ツイート
& vblf & "premere no per abortire." ツイート
& vblf & "attenzione il cambio di spessore deve essere gestito a mano.", "ilogic - elabora dwg ファイル ",messageboxbuttons.yesno"
rusure = vbno なら、
フィードバック
端 もし
opath = このドキュメント.path
現在のスタイル = シートメタル.getactivestyle()
codice_regola = 右(currentstyle, 10)
num_part=iproperties.value("プロジェクト", "部品番号")
codiceinizio = left(num_part), 3) 3)
'specifica la cartella di destinazione per il dwg
ofolder = thisdoc.path と "\" と "laserdwg" と "\" と codiceinizio と "_" と codice_regola
'controlla se la cartella esiste, oppure la crea
system.io.directory.exists(ofolder)でなければ、
system.io.directory.createdirectory(フォルダ)
端 もし

' --inizio--- questa parte funziona solo per la parte lamiera e non で modifica da assieme
dim odoc = このアプリケーション.activedocument
dim ocompdef シートメタルコンポンデンプション = 何も
odoc.documenttype = documenttypeenum.kassemblydocumentobject の場合 それから
dim assemdoc として アセンブリドキュメント = odoc
'dim odoc = thisapplication.documents.open(iptpathname, false) と
ocompdef = assemdoc.componentdefinition.sheetmetalcomponentdefinition
odoc.documenttype = documenttypeenum.kpartdocumentobject それから
パートドキュメントをpartdocument = odoc
ocompdef = partdoc.componentdefinition'.sheetmetalcomponentdefinition
端 もし
'controlla se esiste un modello piatto; altrimenti lo crea
ocompdef.hasflatpattern = false の場合、
ocompdef.unfoldの
その他
ocompdef.flatpattern.edit は、
端 もし
' --fine--- questa parte funziona solo per la parte lamiera e non で modifica da assieme

' --inizio-- ソロ per lamiera
'controlla se esiste un modello piatto; altrimenti lo crea
'dim odoc をpartdocumentとして
'odoc = このアプリケーション.activedocument
'dim ocompdef シートメタルコンポンデント定義
'ocompdef = odoc.componentdefinition
'if ocompdef.hasflatpattern = false 以降
'ocompdef.unfold ディレクティブ
エルシー
'ocompdef.flatpattern.edit は、
もしも
' --fine-- - ラミララあたりのソロ

'settaggioのdwg
dim オプションリストをリスト(文字列) = new list(of string)()

optionlist.add("acadversion=2004")
optionlist.add("outerprofilelayer=0")
optionlist.add("interiorprofileslayer=0")

dim sout を文字列として
dim spath 文字列として
sout = "フラットパターンdwg?acadversion=2004&outerprofilelayer=iv_interior_profiles"_
+ "&invisiblelayers=iv_tangent;iv_feature_profiles_down;iv_arc_center;iv_bend;iv_bend_down;iv_tool_center;iv_tool_center_down;iv_feature_profiles;iv_feature_profiles_down"

各オプションリストで選択
sout = sout と "&" と sout = sout と "&" のオプション
次へ

dim sfname 文字列
sfname = ofolder & "\" & thisdoc.filename(false) & ".dwg"

'esporta il ファイル dwg
ocompdef.dataio.writedatatofile( sout, sfname) のファイル
dim osmdef として シートメタルコンポンデント定義
osmdef = odoc.componentdefinition
osmdef.flatpattern.exitedit は、
messagebox.show("dwg salvato in: "&sfname, "lamiera - esportazione completata!",messageboxbuttons.ok)
一緒にルール:
Code:
'salva_modellopiatto_01 さん
このapplication.activedocument.documenttype <> ドキュメントtypeenum.kassemblydocumentobject の場合、
messagebox.show("e' un'assieme") は、 (non fa niente, ma la regola viene eseguita; messaggio da eliminare), "controllo")
出口のサブ
端 もし
opath = このドキュメント.path
現在のスタイル = シートメタル.getactivestyle()
codice_regola = 右(currentstyle, 10)
num_part=iproperties.value("プロジェクト", "部品番号")
codiceinizio = left(num_part), 3) 3)
'specifica la cartella di destinazione per il dwg
ofolder = thisdoc.path と "\" と "laserdwg" と "\" と codiceinizio と "_" と codice_regola
'controlla se la cartella esiste, oppure la crea
system.io.directory.exists(ofolder)でなければ、
system.io.directory.createdirectory(フォルダ)
端 もし

' --inizio--- questa parte funziona solo per la parte lamiera e non で modifica da assieme
dim odoc = このアプリケーション.activedocument
dim ocompdef シートメタルコンポンデンプション = 何も
odoc.documenttype = documenttypeenum.kassemblydocumentobject の場合 それから
dim assemdoc として アセンブリドキュメント = odoc
'dim odoc = thisapplication.documents.open(iptpathname, false) と
ocompdef = assemdoc.componentdefinition.sheetmetalcomponentdefinition
odoc.documenttype = documenttypeenum.kpartdocumentobject それから
パートドキュメントをpartdocument = odoc
ocompdef = partdoc.componentdefinition'.sheetmetalcomponentdefinition
端 もし
'controlla se esiste un modello piatto; altrimenti lo crea
ocompdef.hasflatpattern = false の場合、
ocompdef.unfoldの
その他
ocompdef.flatpattern.edit は、
端 もし
' --fine--- questa parte funziona solo per la parte lamiera e non で modifica da assieme

' --inizio-- ソロ per lamiera
'controlla se esiste un modello piatto; altrimenti lo crea
'dim odoc をpartdocumentとして
'odoc = このアプリケーション.activedocument
'dim ocompdef シートメタルコンポンデント定義
'ocompdef = odoc.componentdefinition
'if ocompdef.hasflatpattern = false 以降
'ocompdef.unfold ディレクティブ
エルシー
'ocompdef.flatpattern.edit は、
もしも
' --fine-- - ラミララあたりのソロ

'settaggioのdwg
dim オプションリストをリスト(文字列) = new list(of string)()

optionlist.add("acadversion=2004")
optionlist.add("outerprofilelayer=0")
optionlist.add("interiorprofileslayer=0")

dim sout を文字列として
dim spath 文字列として
sout = "フラットパターンdwg?acadversion=2004&outerprofilelayer=iv_interior_profiles"_
+ "&invisiblelayers=iv_tangent;iv_feature_profiles_down;iv_arc_center;iv_bend;iv_bend_down;iv_tool_center;iv_tool_center_down;iv_feature_profiles;iv_feature_profiles_down"

各オプションリストで選択
sout = sout と "&" と sout = sout と "&" のオプション
次へ

dim sfname 文字列
sfname = ofolder & "\" & thisdoc.filename(false) & ".dwg"

'esporta il ファイル dwg
ocompdef.dataio.writedatatofile( sout, sfname) のファイル
dim osmdef として シートメタルコンポンデント定義
osmdef = odoc.componentdefinition
osmdef.flatpattern.exitedit は、
messagebox.show("dwg salvato in: "&sfname, " assieme - esportazione completata!",messageboxbuttons.ok)
解決策を教えてください。 お問い合わせ
 
こんにちは。
数日間、私は本当に良い見て時間を持っていないが、あなたは複雑な取得しています。 エクスポートルールをイベントトリガーパーツに接続しているもの> ドキュメントを保存する前に、その部分がシートであり、エクスポートを続行するかどうかをチェックしてルールを起動します。その部分が規則が実行され、トリガーを引き起こした文書に「thisdoc」ポイントがポイントされます。設定されているかどうかにかかわらず、ローカル編集または単一の部分の編集中。 外部ルールを使用するのに理想的です。
 
お問い合わせ
興味を寄せていただきありがとうございます。アドバイスから既存のルールを変更しました。
残念ながら結果は変更されません。, あなたは、単一の部分でエクスポートすることができますが、軸線の編集中に. (私はドキュメントを保存する前に、その部分でトリガーを変更しました)私は、実用的ではないので、ルールを添付します。
Code:
snippet'salva_modellopiatto_03のコード
'controlla se il file è una 部分
パートドキュメントをpartdocumentとして
もし thisapplication.activedocument.documenttype <> kpartdocumentobject その後
messagebox.show ("si prega di aprire un documento 部分, "ilogic")
端 もし
'messaggio di testo si/no
rusure = メッセージボックス.show( _)
"salva dwg dal modello piatto." ツイート
・vblf & "premere Yes per continuare" ツイート
& vblf & "premere no per abortire." ツイート
& vblf & "attenzione il cambio di spessore deve essere gestito a mano.", "ilogic - elabora dwg ファイル ",messageboxbuttons.yesno"
rusure = vbno なら、
フィードバック
端 もし

opath = このドキュメント.path
現在のスタイル = シートメタル.getactivestyle()
codice_regola = 右(currentstyle, 10)
num_part=iproperties.value("プロジェクト", "部品番号")
codiceinizio = left(num_part), 3) 3)
'specifica la cartella di destinazione per il dwg
ofolder = thisdoc.path と "\" と "laserdwg" と "\" と codiceinizio と "_" と codice_regola
'controlla se la cartella esiste, oppure la crea
system.io.directory.exists(ofolder)でなければ、
system.io.directory.createdirectory(フォルダ)
端 もし

' --inizio-- ソロ per lamiera
'controlla se esiste un modello piatto; altrimenti lo crea
dim odoc として partdocument
odoc = このアプリケーション.activedocument
dim ocompdef シートメタルコンポンデント定義
ocompdef = odoc.componentdefinition
ocompdef.hasflatpattern = false の場合、
ocompdef.unfoldの
その他
ocompdef.flatpattern.edit は、
端 もし
' --fine-- - ラミララあたりのソロ

'settaggioのdwg
dim オプションリストをリスト(文字列) = new list(of string)()

optionlist.add("acadversion=2004")
optionlist.add("outerprofilelayer=0")
optionlist.add("interiorprofileslayer=0")

dim sout を文字列として
dim spath 文字列として
sout = "フラットパターンdwg?acadversion=2004&outerprofilelayer=iv_interior_profiles"_
+ "&invisiblelayers=iv_tangent;iv_feature_profiles_down;iv_arc_center;iv_bend;iv_bend_down;iv_tool_center;iv_tool_center_down;iv_feature_profiles;iv_feature_profiles_down"

各オプションリストで選択
sout = sout と "&" と sout = sout と "&" のオプション
次へ

dim sfname 文字列
sfname = ofolder & "\" & thisdoc.filename(false) & ".dwg"

'esporta il ファイル dwg
ocompdef.dataio.writedatatofile( sout, sfname) のファイル
dim osmdef として シートメタルコンポンデント定義
osmdef = odoc.componentdefinition
osmdef.flatpattern.exitedit は、
'messaggio ディ testo ok
messagebox.show("dwg salvato in: "&sfname, "lamiera - esportazione completata!",messageboxbuttons.ok)
一緒に編集するとき、保存すると、コントロールメッセージの部分から「部分の文書を開く」、 "ilogic" から取り出します。
Errore_03_part.JPGそしてpoi questo errore...
Errore_03.JPGErrore_03_infoA.JPGErrore_03_infoB.JPG私はあなたの時間に感謝し、私はすぐに答えを与えることができるかどうか心配しないでください、その間に私は他のテストを行います。
ご挨拶
 
フライで、ilogic vien の automatisms を悪用して、ドキュメントを "enter" に提案する
odoc = このドキュメント.document

(ilogic thisdocはルールのトリガーをトリガーするドキュメントです)

この application.activedocument.documenttype はメインウィンドウで開いたドキュメントなので、常に axieme を呼び出します。
 
フライで、ilogic vien の automatisms を悪用して、ドキュメントを "enter" に提案する
odoc = このドキュメント.document

(ilogic thisdocはルールのトリガーをトリガーするドキュメントです)

この application.activedocument.documenttype はメインウィンドウで開いたドキュメントなので、常に axieme を呼び出します。
ありがとうございます。
 
おはようございます。
私はこのような問題を持っているので、私はこの議論をサポートしています.
開いたすべてのiptファイルのために作成されたフラットモデルをエクスポートする必要があります。

この ilogic ルールを使用する:
Code:
'ファイルパスを設定します。
setfilepath = "\\\srvfs\ufftecnico\anno2022\dbf\07625 - parapetto copertura\programmazione\3d"

パートドキュメントをpartdocumentとして
もし thisapplication.activedocument.documenttype <> kpartdocumentobject その後
messagebox.show(部分の文書、"ilogic"を開く)
端 もし

フラットパターンのチェック >> 必要に応じて 1 つを作成
dim odoc として partdocument
odoc = このアプリケーション.activedocument
dim ocompdef シートメタルコンポンデント定義
ocompdef = odoc.componentdefinition
ocompdef.hasflatpattern = false の場合、
ocompdef.unfoldの

その他
ocompdef.flatpattern.edit は、
端 もし

'dxf の設定
dim sout を文字列として
dim spath 文字列として
sout = "フラットパターンdxf?acadversion=2000" _
+ "&outerprofilelayer=0" を生成します。
+「&outerprofilelayercolor=0;0;0」_
+ "&interiorprofileslayer=0" _ テンプレート
+ "&interiorprofileslayercolor=0;0;0" _
+「&benduplayercolor=255;0;0」_
+「&benddownlayercolor=255;0;0」_
+「&featureprofilesuplayercolor=255;255;0」_
+ 「&unconsumedsketcheslayercolor=255;255;0」_
+ "&invisiblelayers=iv_arc_center;iv_tangent;iv_roll;iv_roll_tangent;iv_altrep_back;iv_altrep_front;iv_feature_profiles_down;iv_tool_center_down;digi_marker_tool_1;digi_marker_tool_2;iv_inner_profiles

odoc = このドキュメント.document

dim ofiledlg として発明者。 filedialog = いいえ
inventorvb.application.createfiledialog(ofiledlg) は、

iniledlg.initialdirectory = thisdoc.workspacepath()
ofiledlg.filename = thisdoc.filename と ".dxf" は、プロパティを要件ごとに設定します。
iniledlg.cancelerror = true の
エラーで次の再開
iniledlg.showsave() は、
もし err.number <> 0 それから
messagebox.show("ファイル保存なし", "ilogic: ダイアログキャンセル")
soif ofiledlg.filename <> "" 以降
myfile = ofiledlg.filename のファイル
odoc.saveas(myfile, true) 'true = コピーとして保存し、false = 保存する
端 もし

'dxf をエクスポートし、モデルをバックアップする
ocompdef.dataio.writedatatofile( sout, ofiledlg.filename ) のファイル
dim osmdef として シートメタルコンポンデント定義
osmdef = odoc.componentdefinition
osmdef.flatpattern.exitedit は、

'このアプリケーション。 statusbartext = "@clintbrown3d: dxf 保存先: "&sfname
'messagebox.show("dxf 保存先: "& ofiledlg.filename , "@clintbrown3d: 成功!")
ひとつのファイルで実行しても問題ありませんが、トリガーを使ってすべてのオープンファイルを保存すると、同じdxfが作成されます。 ファイル名が開きますが、アクティブなファイルパターンファイルもあります。
私は私がクリアしたことを願っています

ルールを変更する任意の提案?

お問い合わせ
 

Forum statistics

Threads
46,674
Messages
380,976
Members
2
Latest member
loop80
このフォーラムは、www.cad3d.it/forum1 - イタリアのデザインコミュニティの機械翻訳です。いくつかの用語は正しく翻訳されていません。

Members online

No members online now.
Back
Top