Page 1 of 1
[Solved] What's Going On With This Preview
Posted: Thu Mar 20, 2025 7:28 am
by 333onlyhalfevil
Hello everyone.
One of my scripts switched out my getOperation() preview with what is shown in the attached image. I'm assuming it is because the operation has too many entities. Is that correct or is there some other reason it would be doing this? Also, is there a way to override this for faster computers?
Thank you.
Re: What's Going On With This Preview
Posted: Thu Mar 20, 2025 7:46 am
by CVH
Please define what getOperation(preview) does.
In Preview mode typically the same as in final mode: Returning an ROperation.
The difference is that getOperation(true) is called from (this=)EAction.updatePreview(clear).
And in final mode you call getOperation(false) to definitely add entities to a document by an operation.
You can limit the generated preview entities based on the preview flag.
In final mode add all entities to the operation.
Is everything added to the operation validated and thus valid?
Define 'Too many'. 10, 30 or several hundreds.
Should not be an issue but it may slow down your Preview generation and affect cursor latency.
Regards,
CVH
Re: What's Going On With This Preview
Posted: Fri Mar 21, 2025 8:49 pm
by 333onlyhalfevil
Yeah, you're right, it is something wrong with my script. I just saw the 4 arrows and assumed something was wrong with my script and qcad was switching it out. Apparently it's just a coincidence that it looks like that. My script is drawing something and moving it to a certain position based on where the user's cursor is. The drawing works but the move function is what's messed up. It's centering every entity rather than moving all of them as a whole. I can probably figure it out from here. Thank you for the reply.
Re: [Solved] What's Going On With This Preview
Posted: Sat Mar 22, 2025 6:29 am
by CVH
333onlyhalfevil wrote: ↑Fri Mar 21, 2025 8:49 pm
It's centering every entity rather than moving all of them as a whole.
Typically
move(...) is by an offset vector.
Using the same vector to move individuals should move all as a 'Whole'.
Regards,
CVH