LASTANGLE for custom objects

LASTANGLE for custom objects

thierry_prince
Advocate Advocate
1,022 Views
9 Replies
Message 1 of 10

LASTANGLE for custom objects

thierry_prince
Advocate
Advocate

Hi,

 

We have a custom object that is similar to a polyline and, while in its construction command (and also when the command is finished), we need to update the LASTPOINT and the LASTANGLE system variables.

No problem with the LASPOINT variable, but the LASTANGLE variable is read-only. (Why ?)

 

An example for this need is to launch a transparent command while in the object construction command to calculate the next point with the last one and the orientation of the last segment.

 

Any suggestion ?

(Other than to draw a new line with 'acedCommandS' API function to force the update of the variable, and deleting the line after that.)

 

Thanks.

Thierry

 

0 Likes
1,023 Views
9 Replies
Replies (9)
Message 2 of 10

tbrammer
Advisor
Advisor

I agree that using acedCommandS(L"_line") is a bad idea.

Have you tried to create a new AcDbLine and add it to the modelspace using ARX? You can make the line invisible before you add it to the DB.

This shouldn't disturb your command flow.

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 3 of 10

thierry_prince
Advocate
Advocate

Hi,

Thanks for your answer, but I can't believe that creating a new AcDbLine and adding it to the model space will update the LASTANGLE value.

I'll try it but with very few hope...

Cheers,

Thierry

0 Likes
Message 4 of 10

Anonymous
Not applicable

maybe, to get last entity in any of the spaces (model, paper) that it is a curve (AcDbCurve) and calculate the angle.

0 Likes
Message 5 of 10

thierry_prince
Advocate
Advocate
Sorry LE3, but I don't need to calculate the angle : I would set it in the LASTANGLE system variable 🙂
0 Likes
Message 6 of 10

tbrammer
Advisor
Advisor

I just tried it myself. You're right. It doesn't work.

Neither by appending a new AcDbLine to the modelspace nor using acdbEntMake(resbuf);

 

Sorry. No more ideas right now 😞


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 7 of 10

owenwengerd
Advisor
Advisor

I think the correct way is to use a jig for creating your entity. As far as I know, this should set both LASTPOINT and LASTANGLE (LASTANGLE I guess only if acquireAngle() is called). Note that this behavior may be influenced by the kDontUpdateLastPoint flag.

--
Owen Wengerd
ManuSoft
0 Likes
Message 8 of 10

thierry_prince
Advocate
Advocate

Hi Owen,

Thanks for your answer. I think we are not so far to an acceptable solution.

Effectively, when using a Jig to get a point, the LASTPOINT system variable can be updated or not, regarding of the use of the kDontUpdateLastPoint flag.

But if we consider that our object is similar to a polyline, the AcEdJig::acquireAngle() can't be used to input a vertex, because it returns only an angle.

 

We need that every acquired point update the LASPOINT variable and, starting from the second point, that every new point also update the LASTANGLE variable.

So writen, it seems to be very simple... 🙂

 

0 Likes
Message 9 of 10

owenwengerd
Advisor
Advisor

@thierry_prince wrote:

We need that every acquired point update the LASPOINT variable and, starting from the second point, that every new point also update the LASTANGLE variable.


Have you tested whether acquirePoint() with a basepoint updates LASTANGLE?

--
Owen Wengerd
ManuSoft
0 Likes
Message 10 of 10

thierry_prince
Advocate
Advocate

Hi Owen,

 

Yes I do that.

 

I also read carefully the ObjectArx documentation and nowhere is writen about LASTANGLE.

Even the API function acquireAngle() doesn't update the LASTANGLE variable. It updates only LASTPOINT !

 

I try to update many time the LASTPOINT variable for the case it will update the LASTANGLE automaticly. But not.

 

Cheers

0 Likes