|
YAMA−Q
- 04/7/13(火) 12:35 -
|
|
|
|
こんにちは 初めて投稿させていただきます
Inventor8を使っていますが、色々使い勝手の悪いところが有りまして
困っています。(良い所も有るんですが・・・)
図面ビューパネルで作図したidwのデータを一括でdxfに変換できる
ソフトをご存知の方居られませんか?
図面枚数が100枚近く有りますので、一枚一枚行うのは大変です。
よろしくお願いいたします
|
|
|
|
Gyako
- 04/7/14(水) 7:25 -
|
|
|
|
>idwのデータを一括でdxfに変換できる
>ソフトをご存知の方居られませんか?
そのようなソフトがあるかどうか私は知らないです。
私は IDW完了時 dwg、dxfを出力するように癖をつけてます。
Sub ActiveDrawingDocumentSave()
Dim oDoc As Inventor.Document
Dim fs As Object
Dim filename As String
Dim fullpath As String
Dim Target As String
Dim DefaultPath As String
DefaultPath = "Z:\図面"
Set oDoc = ThisApplication.ActiveDocument
If (oDoc.DocumentType <> kDrawingDocumentObject) Then
MsgBox "エラー:ドキュメント タイプが、図面ではありません。"
Set oDoc = Nothing
Exit Sub
End If
oDoc.Save
Set fs = CreateObject("Scripting.FileSystemObject")
fullpath = oDoc.FullFileName
filename = fs.GetFileName(fullpath)
Target = DefaultPath & "\dxf\" & Left$(filename, Len(filename) - 3) & "dxf"
Call ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent, Target)
Call ThisApplication.CommandManager.StartCommand(kFileSaveCopyAsCommand)
DoEvents
Target = DefaultPath & "\dwg\" & Left$(filename, Len(filename) - 3) & "dwg"
Call ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent, Target)
Call ThisApplication.CommandManager.StartCommand(kFileSaveCopyAsCommand)
DoEvents
Target = DefaultPath & "\dwf\" & Left$(filename, Len(filename) - 3) & "dwf"
Call ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent, Target)
Call ThisApplication.CommandManager.StartCommand(kFileSaveCopyAsCommand)
DoEvents
Set oDoc = Nothing
Set fs = Nothing
End Sub
|
|
|
|
YAMA−Q
- 04/7/14(水) 10:01 -
|
|
|
|
回答有難うございます
やはり無いのでしょうか?
図面作成時にidw、dxf、dwgで登録するのは
判ってはいるのですが、忙しいとつい怠ってしまうんです
習慣付けが必要なようですね
|
|
|
|
|
|
↓こんなマクロで一括変換できると思いますけど
(IDW をエクスプローラからドラッグ&ドロップで一気に
開いてマクロを実行すると同じフォルダにDXFファイル
ができます)
Public Sub ExportToDxf()
Set oApp = GetObject(, "Inventor.Application")
If Err Then
MsgBox "Inventor must be running."
End
End If
If oApp.Documents.Count = 0 Then
MsgBox "At leaset one opened document must exist."
End
End If
Dim oDoc As Inventor.Document
For Each oDoc In oApp.Documents
If (oDoc.DocumentType <> kDrawingDocumentObject) Then
MsgBox "Error:Document type is not drawing"
Else
Dim sFname As String 'Get document's full file name
sFname = oDoc.FullFileName
sFname = Left$(sFname, Len(sFname) - 3) & "DXF" 'Rename extension
Call ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent, sFname)
Call ThisApplication.CommandManager.StartCommand(kFileSaveCopyAsCommand)
End If
Next
End Sub
|
|
|
|
 |
 |