Page 1 of 1

Any code to replace document.AcadDocument (object)

Posted: Sat Feb 18, 2023 1:54 am
by kpr
The following code is a part of code to display preview image of blocks.
but the intellicad c# api do not have doc.AcadDocument.
Have any suggest code to use instead of "doc.AcadDocument" ?
Thanks

object ActiveDocument = doc.AcadDocument;
object[] data = { "_.BLOCKICON " + blk.Name + "\n" };
ActiveDocument.GetType().InvokeMember("SendCommand", System.Reflection.BindingFlags.InvokeMethod, null, ActiveDocument, data);

Re: Any code to replace document.AcadDocument (object)

Posted: Sat Feb 18, 2023 3:38 am
by Danielm103
maybe
Application.DocumentManager.MdiActiveDocument.SendStringToExecute("stuff to execute", true, false, false);

untested though

Re: Any code to replace document.AcadDocument (object)

Posted: Sat Feb 18, 2023 7:37 am
by QuanNguyen
Hi,
It seems that the command BLOCKICON is not available now.