Hello
I was wondering if there is a way through iLogic, or API to convert each view to a seperate block while exporting a inventor IDW/DWG file to Autocad file.
Currently I'm using a iLogic method found in Autodesk help to export IDW/DWG to Autocad DWG, I have customized some code for my needs, and I was wondering if You can just write some code so the views would become blocks. I don't care about the scale, what You see is saved as blocks, one view one block, view and cross section to 2 sepatere blocks etc...
Naming of the blocks could depend on file name + sheet name + View number (not view name)
I'd prefer it to be a iLogic solution if possible at all, API is still sorcery to me.
Code I'm using for exporting to AutoCAD dwg is as follows: (code supports multiseet files)
SyntaxEditor Code Snippet
'------start of iLogic------- oPath = ThisDoc.Path oFileName = ThisDoc.FileName(False) 'without extension oRevNum = iProperties.Value("Project", "Revision Number") ' Get the DWG translator Add-In. Dim DWGAddIn As TranslatorAddIn DWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}") 'Set a reference to the active document (the document to be published). Dim oDocument As Document oDocument = ThisApplication.ActiveDocument Dim oContext As TranslationContext oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = kFileBrowseIOMechanism ' Create a NameValueMap object Dim oOptions As NameValueMap oOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Create a DataMedium object Dim oDataMedium As DataMedium oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ' Check whether the translator has 'SaveCopyAs' options If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then ' Path for DWG export ini file Dim strIniFile As String strIniFile = "z:\ExportToAutoCadDWG\ExportToAutoCadDWG_nofile.ini" ' Create the name-value that specifies the ini file to use. oOptions.Value("Export_Acad_IniFile") = strIniFile End If Dim oFolder = oPath & "\DWG Acad" ' Change path in quotes to suit your needs 'Check for the file folder and create it if it does not exist If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If 'Set the DWG target file name If oRevNum = "" oDataMedium.FileName = oFolder & "\" & oFileName & ".dwg" Else 'Set the DWG target file name 'oDataMedium.FileName = oFolder & "\" & oFileName & " R" & oRevNum & ".dwg" oDataMedium.FileName = oFolder & "\" & oFileName & ".dwg" End If 'Publish document. DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) '------end of iLogic-------
Thank You for any effort 🙂
M.
Solved! Go to Solution.
Solved by bradeneuropeArthur. Go to Solution.
Sorry for the late reply.
No I havent found any solution for that issue.
Hi @M
All Views are already available as Autocad block there is no coding needed.
In the drawing Browser you find the Autocad Blocks Folder.
Regards,
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !