jig problem?

jig problem?

Anonymous
Not applicable
1,309 Views
9 Replies
Message 1 of 10

jig problem?

Anonymous
Not applicable
I wish to realize dynamic dimension like autocad do, but i am not familar with jig, could someone has some example about how to realize jig?
0 Likes
1,310 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Have you looked at the EllipseJig sample from the SDK?

Albert

wrote in message news:4879122@discussion.autodesk.com...
I wish to realize dynamic dimension like autocad do, but i am not familar
with jig, could someone has some example about how to realize jig?
0 Likes
Message 3 of 10

Anonymous
Not applicable
Yes,I have looked at the ellipsejig sample, but I still don't understand how to use jig.My aids is to realize my continuous dimension command like autocad.
0 Likes
Message 4 of 10

Anonymous
Not applicable
You should look at it one more time.
Its a very basic example of how to use Jig.

In Jig are few Essential functions that MUST be overriden:
entity() -> here you give back entity you operating on;
update() -> here you perform all update (set) operations on your entity;
sampler() -> here you perform any user input interaction;

The Sample Funktion doIt() must be written by you.
To start interacting with user use the drag() function.
It calls the sampler, update, entity functions and it calls the entitys
worlddraw() function to draw it on screen.

Those functions are absolue minimum to code an Jig mechanism for your
entity.
There are still fev functions you can use. For deteils read the docs.

Regards
Rex

schrieb im Newsbeitrag news:4880034@discussion.autodesk.com...
Yes,I have looked at the ellipsejig sample, but I still don't understand how
to use jig.My aids is to realize my continuous dimension command like
autocad.
0 Likes
Message 5 of 10

Anonymous
Not applicable
Forgotten one function:
append() -> you need it to add your entity that is returned
by entity() function to DB. (If you want to add it to db 😉 ).

Regards
Rex



schrieb im Newsbeitrag news:4880034@discussion.autodesk.com...
Yes,I have looked at the ellipsejig sample, but I still don't understand how
to use jig.My aids is to realize my continuous dimension command like
autocad.
0 Likes
Message 6 of 10

Anonymous
Not applicable
I'm not sure what you mean by continuous dimension command. Which command
are you talking about?

Albert
wrote in message news:4880034@discussion.autodesk.com...
Yes,I have looked at the ellipsejig sample, but I still don't understand how
to use jig.My aids is to realize my continuous dimension command like
autocad.
0 Likes
Message 7 of 10

Anonymous
Not applicable
continuous dimension command is my custom command,it works like autocad command ( _dimcontinue ),but doesn't need to select first dimension.
the following code works well, but in process of debug, I found the bug of rotationdimension again, rotationdimension's rotation property always throw a exception.

protected override bool Update()
{
try
{
switch (mPromptCounter)
{
case 0:
GetRotationAndDimensionDirectio();
break;
case 1:
break;
}
GetNewEndPoint();
RotatedDimension dimEnt = ((RotatedDimension)Entity);
//dimEnt = new RotatedDimension(mRotation, mStartPt, mNewEndPt, mLocPt, "", ObjectId.Null); // this line will make dynamic dimension dispear
dimEnt.XLine1Point = mStartPt;
dimEnt.XLine2Point = mNewEndPt;
dimEnt.DimLinePoint = mLocPt;
dimEnt.Rotation = mRotation; // this line will throw a exception
}
catch (System.Exception)
{
return false;
}
return true;

}
0 Likes
Message 8 of 10

Anonymous
Not applicable
Can you post a little bit more code that I could try to run here? Are you
creating the dimEnt below with the default constructor? I have already
confirmed that to you that it won't work.

Albert
wrote in message news:4881324@discussion.autodesk.com...
continuous dimension command is my custom command,it works like autocad
command ( _dimcontinue ),but doesn't need to select first dimension.
the following code works well, but in process of debug, I found the bug of
rotationdimension again, rotationdimension's rotation property always throw
a exception.

protected override bool Update()
{
try
{
switch (mPromptCounter)
{
case 0:
GetRotationAndDimensionDirectio();
break;
case 1:
break;
}
GetNewEndPoint();
RotatedDimension dimEnt = ((RotatedDimension)Entity);
//dimEnt = new RotatedDimension(mRotation, mStartPt,
mNewEndPt, mLocPt, "", ObjectId.Null); // this line will make dynamic
dimension dispear
dimEnt.XLine1Point = mStartPt;
dimEnt.XLine2Point = mNewEndPt;
dimEnt.DimLinePoint = mLocPt;
dimEnt.Rotation = mRotation; // this line will throw a
exception
}
catch (System.Exception)
{
return false;
}
return true;

}
0 Likes
Message 9 of 10

Anonymous
Not applicable
albert, the attachment is my complete code.
0 Likes
Message 10 of 10

Anonymous
Not applicable
Yes. You are using the default constructor of RotatedDimension. Chage
: base(new RotatedDimension())
to
: base(new RotatedDimension(mRotation, mStartPt, mNewEndPt, mLocPt, "",
ObjectId.Null))

Albert
wrote in message news:4881360@discussion.autodesk.com...
albert, the attachment is my complete code.
0 Likes