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.
[Solved] What's Going On With This Preview
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
-
- Full Member
- Posts: 92
- Joined: Fri Apr 28, 2023 12:39 pm
[Solved] What's Going On With This Preview
- Attachments
-
- preview.jpg (36.29 KiB) Viewed 52328 times
Last edited by 333onlyhalfevil on Fri Mar 21, 2025 8:49 pm, edited 1 time in total.
-
- Premier Member
- Posts: 4943
- Joined: Wed Sep 27, 2017 4:17 pm
Re: What's Going On With This Preview
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
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
-
- Full Member
- Posts: 92
- Joined: Fri Apr 28, 2023 12:39 pm
Re: What's Going On With This Preview
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.
-
- Premier Member
- Posts: 4943
- Joined: Wed Sep 27, 2017 4:17 pm
Re: [Solved] What's Going On With This Preview
Typically move(...) is by an offset vector.333onlyhalfevil wrote: ↑Fri Mar 21, 2025 8:49 pmIt's centering every entity rather than moving all of them as a whole.
Using the same vector to move individuals should move all as a 'Whole'.
Regards,
CVH