.NET

Reply
Valued Contributor
wbdehaan
Posts: 64
Registered: ‎11-01-2001
Message 1 of 2 (197 Views)
Accepted Solution

Open drawing - commandflag.session - there is no sourcecode for this location

197 Views, 1 Replies
03-19-2013 12:40 AM

Hi,

 

When opening a drawing I have errors:

1. the drawing is opened, but it freezes during open-command, and is not activated, OR

2. the drawing is opened, but I cannot start the program a second time, then it gives an error.

 

explanation:

 

I have a project with an attached large 'common' project, which I attached with "menu file > add > exisiting project" in VB2008express:

 

Solution 'CNC' (2 projects)

- CommonMacro   (>>added project)

    - cad.vb

- CNC    (>> main project)

    - main.vb

 

 

1. When I open a drawing, first it freezed during this open-command, and did not activate this drawing. Only after clicking right mouse button, it continued the program, activated the drawing. But this is no option for me.

---

<CommandMethod("CNCP")>Public Sub StartProgrammaProductie()

 

    cad.init    (>> routine in commonmacro-project)

 

    Dim acDocMgr As DocumentCollection = Application.DocumentManager

    Dim Nieuwbestand as document

    NieuwBestand = acDocMgr.Open(Pad_en_Bestand, BestandsInfo.IsReadOnly)   (>>>FREEZE)

    acDocMgr.MdiActiveDocument = NieuwBestand

end sub

---

 

 

2. I added commandflag.session to the subroutine, the first time I use "CNCP" the drawing is opened fine, but now when the second time I start my program and a drawing is opened, it loses contact with the common project

---

<CommandMethod("CNCP", CommandFlags.Session)>Public Sub StartProgrammaProductie()

 

    cad.init     (>> ERROR: there is no sourcecode for this location)

 

    Dim acDocMgr As DocumentCollection = Application.DocumentManager

    Dim Nieuwbestand as document

    NieuwBestand = acDocMgr.Open(Pad_en_Bestand, BestandsInfo.IsReadOnly)

acDocMgr.MdiActiveDocument = NieuwBestand

end sub

---

 

How can I open and activate drawing's and still have connection to the common project dll? 

or how do I end a routine properly?

 

kind regards

 

Wouter de Haan

 

 

Hi there,

 

solved my problem by turning the GUI.Showdialog to GUI.show

 

Wouter

Valued Contributor
wbdehaan
Posts: 64
Registered: ‎11-01-2001
Message 2 of 2 (175 Views)

Re: Open drawing - commandflag.session - there is no sourcecode for this locatio

03-19-2013 07:49 AM in reply to: wbdehaan

Hi there,

 

solved my problem by turning the GUI.Showdialog to GUI.show

 

Wouter

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!