Hi All
Does anyone know of a way to reload Hatches
Without having to restart QCAD.
Example updating and testing a perticalar hatch
To see changes without restarting.
AutoCAD automatically updates if hatch is changed..
Looking for "if possible" :-
A script?
A command that can be typed into command prompt..
Any help appreciated
Cheers
John
[solved] Reloading Hatches without restarting QCAD
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
[solved] Reloading Hatches without restarting QCAD
Last edited by John Hyslop on Sun Aug 30, 2020 6:45 am, edited 2 times in total.
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Reloading Hatches without restarting QCAD
Hi John,
I expressed the same frustations .... a while ago.
On good days QCAD is restarted about 200-500 times a day.
On bad days ....
Both in normal mode or in debugger mode.
A custom file handler with T2H was already nececary because of the restrictions for pattern names.
I altered that lateron so it generates up to 99 alternative names on overwrite.
That way I can created a bunch of test versions side by side ... before rebooting.
QCAD can't store these files directly to the protected OS portion on a standard win installation.
I have to move them in as Admin.
QCAD with the rescan option already reloads addon's, that is fine when T2H is altered even in debugger mode.
The re-open former files is already a big time saver on reboot.
For reloading pat patterns I didn't find any alternative as a reboot.
In fact it's merely an internal list that has to be updated.
Like the resync for libraries.
And that is done in RPatternList.cpp
Called only from main.cpp
In other words: On boot.
Regards,
CVH
I expressed the same frustations .... a while ago.
On good days QCAD is restarted about 200-500 times a day.
On bad days ....
Both in normal mode or in debugger mode.
A custom file handler with T2H was already nececary because of the restrictions for pattern names.
I altered that lateron so it generates up to 99 alternative names on overwrite.
That way I can created a bunch of test versions side by side ... before rebooting.
QCAD can't store these files directly to the protected OS portion on a standard win installation.
I have to move them in as Admin.
QCAD with the rescan option already reloads addon's, that is fine when T2H is altered even in debugger mode.
The re-open former files is already a big time saver on reboot.
For reloading pat patterns I didn't find any alternative as a reboot.
In fact it's merely an internal list that has to be updated.
Like the resync for libraries.
And that is done in RPatternList.cpp
Called only from main.cpp
In other words: On boot.
Regards,
CVH
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Reloading Hatches without restarting QCAD
Hi CVH
Well at least it opens up last saved drawings now...
Thanks for the feedback..
Cheers
John
Well at least it opens up last saved drawings now...
Thanks for the feedback..
Cheers
John
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Reloading Hatches without restarting QCAD
Next question would be:
Is it even possible ... ?
It is of no issue for lib's because they actually put a non related copy in the drawing.
What happens if you alter a pat definition while that is used as a pattern in the current drawing ... ?
This is before save ... In drawings opened the stored pattern is used !!!
Line types is similar but for that there is a reload in Misc .. Modify ... The script is even very simple.
And for what it is worth, I can't even find the text 'hatchregen' in the (open) resources.
That should be a DefaultCommand text of the Hatch Regeneration in Misc .. Modify
Regards,
CVH
Is it even possible ... ?
It is of no issue for lib's because they actually put a non related copy in the drawing.
What happens if you alter a pat definition while that is used as a pattern in the current drawing ... ?
This is before save ... In drawings opened the stored pattern is used !!!
Line types is similar but for that there is a reload in Misc .. Modify ... The script is even very simple.
And for what it is worth, I can't even find the text 'hatchregen' in the (open) resources.
That should be a DefaultCommand text of the Hatch Regeneration in Misc .. Modify
Regards,
CVH
Re: Reloading Hatches without restarting QCAD
Hatch patterns are stored in the drawing file, as part of the drawing as soon as they are used in the drawing. When a drawing is loaded, the hatch pattern as stored in the drawing is used. This is important for drawing exchange as user A might have different hatch patterns than user B.
To reload pattern definitions from the .pat files that come with QCAD, you'd have to reinitialize the patterns from the .pat files and also update the patterns in the document from the list of global patterns:
As this is all under the hood, this will not immediately update the display. Selecting the hatch or selecting all entities would take care of that.
To reload pattern definitions from the .pat files that come with QCAD, you'd have to reinitialize the patterns from the .pat files and also update the patterns in the document from the list of global patterns:
Code: Select all
// reload patterns from .pat files:
RPatternListMetric.init();
// force update of patterns in document:
doc=getDocument();
doc.setMeasurement(RS.Metric);
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Reloading Hatches without restarting QCAD
Fantastic
Thanks Andrew
Cheers
John
Thanks Andrew
Cheers
John
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Reloading Hatches without restarting QCAD
Thanks Andrew :P
Took seconds to implement.
Regards,
CVH
Took seconds to implement.
Regards,
CVH
Re: Reloading Hatches without restarting QCAD
That was for METRIC documents.
We are swapping measurement systems and/or have different documents types open.
For IMPERIAL documents use:
Works for both I presume.
CVH
We are swapping measurement systems and/or have different documents types open.
For IMPERIAL documents use:
Code: Select all
RPatternListImperial.init();
&
doc.setMeasurement(RS.Imperial);
Code: Select all
doc = getDocument();
// Reload patterns from .pat files:
doc.isMetric() ? RPatternListMetric.init() : RPatternListImperial.init();
// Force update of patterns in document:
doc.setMeasurement(doc.getMeasurement());
CVH