Entity Gig provide more interactive way to get input from user rather than autocad usual getting input from editor
Entity Jig automatically update autocad active graphics depending on user live input, make it much more visual than regular autocad commands where you can only see all changes when command is done
but with using Entity Jig user will be able to see all changes made to drawing in real time, this can reduce number of adjustment user need to do when something is autogenerated by code
How it work?
Entity Jig Class is AutoCAD Inbuit Abstract Class, we have to write our own code to create jig using this class
Entity Jig Class has 3 parts Constructor, Sampler Method and Update method
Constructor Basically Get entity inputs from client
Sampler Method contain code to get jig input from user and return SampleStatus as output
Update Method update our Entity if successful results are given by user in Sampler Method
Sample Code
publicstaticclassCommands{[CommandMethod("Test", CommandFlags.UsePickSet)]publicstaticvoidTest(){try{vardoc=Application.DocumentManager.MdiActiveDocument;vardb=doc.Database;vared=doc.Editor;varppo=newPromptPointOptions("\nCenter: ");varppr=ed.GetPoint(ppo);if(ppr.Status!=PromptStatus.OK)return;using(vartransaction=ActiveUtil.TransactionManager.StartTransaction()){varcircle=newCircle(ppr.Value,Vector3d.ZAxis,1.0);circle.TransformBy(ed.CurrentUserCoordinateSystem);varjig=newCircleJig(circle);varpr=ed.Drag(jig);if(pr.Status==PromptStatus.OK){varcurSpace=(BlockTableRecord)transaction.GetObject(db.CurrentSpaceId,OpenMode.ForWrite);curSpace.AppendEntity(circle);transaction.AddNewlyCreatedDBObject(circle,true);}transaction.Commit();}}catch(System.Exceptionex){Application.ShowAlertDialog($"Something went wrong error:{ex.Message}");}}}classCircleJig:EntityJig{Circlecircle;doubleradius;Point3dbasePoint;publicCircleJig(Circlecircle):base(circle){this.circle=circle;basePoint=circle.Center;radius=circle.Radius;}protectedoverrideSamplerStatusSampler(JigPromptsprompts){varoptions=newJigPromptDistanceOptions("\nRadius: ");options.BasePoint=basePoint;options.UseBasePoint=true;options.Cursor=CursorType.RubberBand;options.UserInputControls=UserInputControls.Accept3dCoordinates|UserInputControls.UseBasePointElevation;varresult=prompts.AcquireDistance(options);if(result.Value==0.0||result.Value==radius)returnSamplerStatus.NoChange;radius=result.Value;returnSamplerStatus.OK;}protectedoverrideboolUpdate(){circle.Radius=radius;returntrue;}}