CodePudding user response:
Document doc=Application. The DocumentManager. MdiActiveDocument;
The Database db=doc. Database;
The Editor Ed=doc. Editor;
PromptEntityResult per=Ed GetEntity (new PromptEntityOptions (" \ nSelect a Block "));//select a piece of
If (per the Status!=PromptStatus. OK)
return;
Using (Transaction trans=db. The TransactionManager. StartTransaction ())
{
BlockReference block=per. ObjectId. GetObject (OpenMode. ForWrite) as BlockReference;
Block. The Rotation=block. The Rotation + math.h PI/2.
Trans.Com MIT ();
}