How to Create a WMF File in IJCAD

Asked 1 years ago, Updated 1 years ago, 118 views

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

.net ijcad

2022-09-30 21:37

1 Answers

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


2022-09-30 21:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.