.NET

Reply
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 1 of 10 (160 Views)

jig problem?

160 Views, 9 Replies
06-19-2005 08:33 PM
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?
*Albert Szilvasy
Message 2 of 10 (160 Views)

Re: jig problem?

06-20-2005 11:03 AM 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?
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 3 of 10 (160 Views)

Re: jig problem?

06-20-2005 05:31 PM 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.
*rex12
Message 4 of 10 (160 Views)

Re: jig problem?

06-21-2005 04:01 AM 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.
*rex12
Message 5 of 10 (160 Views)

Re: jig problem?

06-21-2005 04:04 AM 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 :smileywink: ).

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.
*Albert Szilvasy
Message 6 of 10 (160 Views)

Re: jig problem?

06-21-2005 08:41 AM 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.
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 7 of 10 (160 Views)

Re: jig problem?

06-21-2005 05:23 PM 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;

}
*Albert Szilvasy
Message 8 of 10 (160 Views)

Re: jig problem?

06-21-2005 05:48 PM 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;

}
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 9 of 10 (160 Views)

Re: jig problem?

06-21-2005 06:05 PM in reply to: netcai
albert, the attachment is my complete code.
*Albert Szilvasy
Message 10 of 10 (160 Views)

Re: jig problem?

06-21-2005 09:23 PM 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community