Community
Hello
Is it possible to have a prompt double options while in JIG and use its result to update a jigged block reference scale in real time?
this is the code that I have but the screen flickers:
public class JigBlockReference : EntityJig
{
protected Point3d dragPoint;
protected BlockReference blockReference;
private bool _firstLoop;
public JigBlockReference(BlockReference br,bool firstLoop)
: base(br)
{
this.blockReference = br;
dragPoint = br.Position;
_firstLoop = firstLoop;
}
protected override SamplerStatus Sampler(JigPrompts prompts)
{
var ops = new JigPromptStringOptions("Enter scale");
var res = prompts.AcquireString(ops);
if(double.TryParse(res.StringResult, out double scale))
{
blockReference.ScaleFactors = new Scale3d(scale);
}
var options = new JigPromptPointOptions("\nSpecify destination point");
options.UserInputControls = (UserInputControls.GovernedByOrthoMode);
var result = prompts.AcquirePoint(options);
if (dragPoint.IsEqualTo(result.Value))
return SamplerStatus.NoChange;
else
dragPoint = result.Value;
return SamplerStatus.OK;
}
protected override bool Update()
{
blockReference.Position = dragPoint;
return true;
}
}
var blockRef = new BlockReference(Point3d.Origin, blockDef);
blockRef.TransformBy(ed.CurrentUserCoordinateSystem);
var jig = new JigBlockReference(blockRef, firstLoop);
var jigResult = ed.Drag(jig);
if (jigResult.Status == PromptStatus.OK)
{
var curSpace = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
curSpace.AppendEntity(blockRef);
tr.AddNewlyCreatedDBObject(blockRef, true);
}
"Enter Scale" wont show unless I press escape.
Solved! Go to Solution.
Solved by ActivistInvestor. Go to Solution.
you can also use a counter, I think the ARX ellipse jig sample does this
Can't find what you're looking for? Ask the community or share your knowledge.