Re: SW 2005 dwgEditor API

Jan 31, 2005 0 Replies

Emma,



Here is the code to connect to DWGEditor from VB(A):



Option Explicit



Public objIcad As DWGEditor.Application Public ActiveDrawing As DWGEditor.Document '// START ACTIVE X CONNECTION // Public Function Connect() As Boolean Dim IcadRunning As Boolean On Error GoTo Err_Control IcadRunning = IsICADOpen() If IcadRunning Then Set objIcad = GetObject(, "DWGEditor.Application") Else Set objIcad = CreateObject("DWGEditor.Application") End If objIcad.Visible = True Set ActiveDrawing = objIcad.ActiveDocument Connect = True Exit_Here: Exit Function Err_Control: MsgBox Err.Description Resume Exit_Here End Function



Function IsICADOpen() As Boolean On Error Resume Next Set objIcad = GetObject(, "DWGEditor.Application") IsICADOpen = (Err.Number = 0) Set objIcad = Nothing Err.Clear End Function



HTH,



Bert



"R&E" schreef in bericht news:xoKKd.14745$ snipped-for-privacy@fe2.news.blueyonder.co.uk...




>
> I want to be able to batch export dwg files (from autocad) or convert a
> drawing someone has done in the editor to dxf.
>
>
>
> I have created a utility to convert to a dxf from the main SW API - but > not
> from the editor. How do you call the editor to even open?
>
>
>
> Thanks
>
>
>
>
>
>> does anyone have any sample API code (VB) for SW 2005 dwgEditor - I want > to
>> be able to use the API to save drawings as a dxf
>>
>> Thanks
>> Emma
>>
>>
>>
>
>

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required