Issue with getPosition() of text entity

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
sarlaa
Active Member
Posts: 47
Joined: Mon Aug 28, 2017 4:39 pm

Issue with getPosition() of text entity

Post by sarlaa » Fri Jun 22, 2018 12:59 pm

Hi,

I have an issue with getPosition() of text entity with this scenario :
I add a text with : position X
I move it to : position Y
and then I do undo : I ask for position, and I get position Y !! while I see in their proprties position X as expected.

It's look like to mee that when I ask for position, it dosen't take the new value or it needs a refresh.

Thanks.

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

Re: Issue with getPosition() of text entity

Post by andrew » Fri Jun 22, 2018 2:45 pm

Could it be that you are working with a copy of the entity, not the real entity? Make sure that you query (re-query) the entity from the document based on its ID.

document.queryEntity(..) always gives you a copy of an entity. That copy does not reflect changes in the drawing. Also, modifying that object has no effect on the drawing (without going adding it to an operation, etc).

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”