I can create WMF files with AutoCAD, but I don't know how to implement them with IJCAD.
Could you please let me know?
The following programs are used to create WMF files in AutoCAD:
Function Import WMF (FullPath As String, ptIns As Point 3d, scale As Double) As String
Dim doc As Autodesk.AutoCAD.ApplicationServices.Document=
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Using doc. LockDocument()
DimacadDoc As Object=
Autodesk.AutoCAD.ApplicationServices.DocumentExtension.GetAcadDocument(doc)
Try
Dimobj As Autodesk. AutoCAD.Interop.Common.AcadObject=acadDoc.Import (FullPath,ptIns.ToArray,scale)
Return obj.Handle
Catch ex As Exception
Return String.Empty
End Try
End Using
End Function
IJCAD's .NET API should allow you to load WMF by using the WMFIN command in the Editor.Command method.
Function Import WMF (FullPath As String, ptIns As Point 3d, scale As Double, rotated As Double) As String
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dimed As Editor=doc.Editor
ed.Command("WMFIN", FullPath, ptIns, scale, scale, rotated)
Dimres As PromptSelectionResult=ed.SelectLast()
Ifres.Status=PromptStatus.OK Then
Return res.Value.GetObjectIds()(0).Handle.ToString()
End If
Return String.Empty
End Function
© 2025 OneMinuteCode. All rights reserved.