.NET

Reply
Valued Contributor
Posts: 62
Registered: ‎05-22-2013
Message 1 of 8 (264 Views)
Accepted Solution

nwcout

264 Views, 7 Replies
10-06-2013 09:14 PM

Hi,

 

I know we can create navis file[.nwc] by using nwcout command but how do we create navis file [.nwc ] programatically.

 

Thanks & Regards

ADN Support Specialist
Posts: 467
Registered: ‎06-02-2009
Message 2 of 8 (224 Views)

Re: nwcout

10-08-2013 02:43 AM in reply to: sanjaymann

There is no API to export to .nwc format. You would need to programmatically send the nwcout command using Document.SendStringToExecute for example.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Valued Contributor
Posts: 62
Registered: ‎05-22-2013
Message 3 of 8 (219 Views)

Re: nwcout

10-08-2013 02:57 AM in reply to: philippe.leefsma

Ok. Got the point.I have used Document.SendStringToExecute with attsync :

Dim blname as String="Test"

 

Dim command As String = "_ATTSYNC Name " + blname + vbCr

           

doc.SendStringToExecute(command, True, False, False)

 

But I am unable to call NWCOUT I tried:

Dim path as String="c:\Test"

 

Dim command As String = "_NWCOUT Path " + path+ vbCr

           

doc.SendStringToExecute(command, True, False, False)

 

ADN Support Specialist
Posts: 467
Registered: ‎06-02-2009
Message 4 of 8 (217 Views)

Re: nwcout

10-08-2013 03:05 AM in reply to: sanjaymann

Which version of AutoCAD are you using? Because in plain AutoCAD I can't see a NWCOUT command...



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Valued Contributor
Posts: 62
Registered: ‎05-22-2013
Message 5 of 8 (210 Views)

Re: nwcout

10-08-2013 03:15 AM in reply to: philippe.leefsma

Autocad 2013

Valued Contributor
Posts: 62
Registered: ‎05-22-2013
Message 6 of 8 (207 Views)

Re: nwcout

10-08-2013 03:24 AM in reply to: philippe.leefsma

The following code prompts me for the path:

Dim dbt AsDatabase = Application.DocumentManager.MdiActiveDocument.Database

           

Dim doc2 AsDocument = Application.DocumentManager.MdiActiveDocument

           

Dim command AsString = "_NWCOUT " + "d:\w.nwc" + vbCr

 doc2.SendStringToExecute(command,True, False, False)

 

How do I manage to pass the file path to the command

ADN Support Specialist
Posts: 467
Registered: ‎06-02-2009
Message 7 of 8 (201 Views)

Re: nwcout

10-08-2013 04:10 AM in reply to: sanjaymann

This needs to be done as follow:

 

[DllImport("accore.dll", CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Cdecl,
    EntryPoint = "acedCommandS")]
private static extern int acedCommandS(
    int type1,
    string str1,
    int type2,
    string str2,
    int end);

[CommandMethod("NwcOutNet")]
public void NwcOutNet()
{
    Document doc = Application.DocumentManager.MdiActiveDocument;

    object filedia = Application.GetSystemVariable("FILEDIA");
    Application.SetSystemVariable("FILEDIA", 0);

    acedCommandS(5005, "_NWCOUT", 5005, "c:\\Temp\\test.nwc", 5000);

    Application.SetSystemVariable("FILEDIA", filedia);

}

 



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Valued Contributor
Posts: 62
Registered: ‎05-22-2013
Message 8 of 8 (163 Views)

Re: nwcout

10-09-2013 01:22 AM in reply to: philippe.leefsma

Thanks. This worked like a charm:smileyhappy:

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community