Spline Event Handler

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
luckyChris
Newbie Member
Posts: 4
Joined: Mon Aug 26, 2013 7:06 pm

Spline Event Handler

Post by luckyChris » Fri Aug 30, 2013 9:16 am

Hi,

I´m new in QCAD - want to extend the spline so that on the line circles within a constant spacing are drawn. While drawing the line, I found some functions where these points can be placed, but my question is: after drawing, when the user moves a control point, which function in SplineControlPoints is called so I can update the position of my circles on the line?

Thanks for anny suggestion!

Chris

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Spline Event Handler

Post by andrew » Tue Sep 03, 2013 2:50 pm

The only way I can think of is to install a transaction listener to get notified whenever something changes in your drawing. Based on the IDs of the object that were affected by the change you would then have to figure out each time which circles belong to which spline. This might work for the lifetime of a drawing and as long as the whole construction is not duplicated, but once the drawing is stored and reloaded from a file, the IDs change and the spline / circle relationship would be lost or would have to be reestablished.

Note that there are many pitfalls to keep in mind: what happens if the spline is deleted, copied to the clipboard, duplicated, etc.

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”