.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing and creating Object after creating a new drawing

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
404 Views, 2 Replies

Changing and creating Object after creating a new drawing

After creatíng a new drawing I want do samething with this new drawing.

After "acDocMgr.MdiActiveDocument = acDoc;" the function stops.

 

What can I do?

 

string strTemplatePath = "HBSolarModulplan.dwt";

//New ProjectData Definition

 

frmProjektData fProjektData = new frmProjektData(false);

Application.ShowModalDialog(fProjektData);

clsACADProjectData hProjectData= fProjektData.ProjectData;

 

//creating a new drawing

DocumentCollection acDocMgr = Application.DocumentManager;

Document acDoc = acDocMgr.Add(strTemplatePath);

 

Database db = acDoc.Database;

acDocMgr.MdiActiveDocument = acDoc;

//this doesnt work

hDraw.SetDrawingProperties(hProjectData);

hDraw.SetProjectProperties(hProjectData);

 

db.TileMode =true;

 

Regards Jürgen

2 REPLIES 2
Message 2 of 3
drauckman
in reply to: Anonymous

you may need to change:

 

 

Application.ShowModalDialog(fProjektData);

 to:

 

 

Application.ShowModalessDialog(fProjektData);

 

 

 

Message 3 of 3
Anonymous
in reply to: Anonymous

 


@Anonymous wrote:

After creatíng a new drawing I want do samething with this new drawing.

After "acDocMgr.MdiActiveDocument = acDoc;" the function stops.

 

What can I do?

 

string strTemplatePath = "HBSolarModulplan.dwt";

//New ProjectData Definition

 

frmProjektData fProjektData = new frmProjektData(false);

Application.ShowModalDialog(fProjektData);

clsACADProjectData hProjectData= fProjektData.ProjectData;

 

//creating a new drawing

DocumentCollection acDocMgr = Application.DocumentManager;

Document acDoc = acDocMgr.Add(strTemplatePath);

 

Database db = acDoc.Database;

acDocMgr.MdiActiveDocument = acDoc;

//this doesnt work

hDraw.SetDrawingProperties(hProjectData);

hDraw.SetProjectProperties(hProjectData);

 

db.TileMode =true;

 

Regards Jürgen


My apologies for resurrecting an old thread but I am hitting the same issue where I want to create a new drawing and then my function stops processing until I close the new drawing that was opened (which of course doesn't work out since my following lines of code use the drwaing file that was just opened).

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost