.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

jig problem?

9 REPLIES 9
Reply
Message 1 of 10
netcai
391 Views, 9 Replies

jig problem?

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?
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: netcai

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?
Message 3 of 10
netcai
in reply to: netcai

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.
Message 4 of 10
Anonymous
in reply to: netcai

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.
Message 5 of 10
Anonymous
in reply to: netcai

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.
Message 6 of 10
Anonymous
in reply to: netcai

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.
Message 7 of 10
netcai
in reply to: netcai

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;

}
Message 8 of 10
Anonymous
in reply to: netcai

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;

}
Message 9 of 10
netcai
in reply to: netcai

albert, the attachment is my complete code.
Message 10 of 10
Anonymous
in reply to: netcai

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost