.NET

.NET

Reply
Valued Contributor
kevinsir
Posts: 78
Registered: ‎08-20-2012
Message 11 of 12 (76 Views)

Re: The layer properties has been set to visible, but layers still can't see

10-13-2012 08:11 PM in reply to: kevinsir

I use custom command!

I find that when I excute the opendwg funtion of  documentcollection

it is different of these two function。

[CommandMethod("openDwg",CommandFlags.Session)]

public void OpenDwg(string fileName)        

{            

Document activeDocument = Application.DocumentManager.Open(fileName,false,string.Empty);  

///after this function  activeDocument is the activedocument 

}

//if i remove the commandflags

[CommandMethod("openDwg")]

public void OpenDwg(string fileName)       

{            

Document activeDocument = Application.DocumentManager.Open(fileName,false,string.Empty); 

///after this function  activeDocument is  ‘drawing1’

///

}

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 12 of 12 (65 Views)

Re: The layer properties has been set to visible, but layers still can't see

10-14-2012 09:39 AM in reply to: kevinsir

Then try again these both commands with adding this line,

but keep the CommandFlags still the same

 

Application.DocumentManager.DocumentActivationEnabled = true;

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
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.