Hi. satya.
Can not know in detail about your program.
But,
there is contents that do not fit in form during code.
acedCommand(RTSTR, "_LINE", RTSTR, "0,0,0", RTSTR,
"10,10,0", RTSTR, "", RTNONE);
Is sorry because do not help.
Best Regards.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
My code contains that line and still the
following code does not work as expected.
The line does not get added to the new file but
instead it gets added to the already opened drawing where the command was
issued. Any suggestions?
AcDbDatabase* pNewDb =
NULL;
acdbHostApplicationServices()->workingDatabase()->wblock(pNewDb);
pNewDb->saveAs("E:\\TEMP\\1.dwg");
delete
pNewDb;
IAcadApplication
app;
IAcadDocuments docs;
IAcadDocument doc;
app.AttachDispatch(acedGetAcadWinApp()->GetIDispatch(TRUE));
docs.AttachDispatch(app.GetDocuments());
doc.AttachDispatch(docs.Open("E:\\TEMP\\1.dwg",
COleVariant((short) FALSE, VT_BOOL)));
doc.Activate();
acedCommand(RTSTR, "_LINE", RTSTR, "0,0,0", RTSTR, "10,10,0",
RTNONE);
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg)
{
case AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(pkt);
size=3>acrxDynamicLinker->registerAppMDIAware(pkt);
// This line insert please.
initApp();
break;
case AcRx::kUnloadAppMsg:
unloadApp();
break;
}
return AcRx::kRetOK;
}
> Hi,
>
How can I write an AutoCAD command which will open a
drawing and add a
> line to it and will close the drawing with saving
the changes. Is there any
> way tro do it?
>
>
Thanks
> satya
>
>