.NET

.NET

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

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

198 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 (176 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.