Unable to get the SnapToObject Settings to take effect  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Unable to get the SnapToObject Settings to take effect

Post by RMan »

We've been trying to modify the Snap to Object settings but it appears that the Editor doesn't actually use the new settings. Do we need to fire an event or something after changing the flags? If we do need to fire an event how do we do that since it appears that the Event.ID is read-only?

I was testing this in VB6

Call PDFEditor.Inst.Settings.SetInt("Measurement.Snapping.Objects.Flags", lFlags)

I can open the Preferences dialog and it displays the proper settings but again the Editor still uses the original values for the which objects it snaps to. I even tried toggling the commands on and off both ways. The only way it will start using the new settings is if I open the Preferences Dialog then the Measurements->Customize and check and uncheck one of the object settings and apply it.

'Toggle Object Snapping on and off
Call PDFEditor.Inst.ExecUICmd("cmd.view.snap")
Call PDFEditor.Inst.ExecUICmd("cmd.view.snap")

'Toggle Object Snapping on and off
Call PDFEditor.Inst.ExecUICmd("cmd.view.snaptoObjects")
Call PDFEditor.Inst.ExecUICmd("cmd.view.snaptoObjects")

'Use settings to toggle on and off
Call PDFEditor.Inst.Settings.SetBool("Measurement.Snapping.Use", False)
Call PDFEditor.Inst.Settings.SetBool("Measurement.Snapping.Use", True)

Call PDFEditor.Inst.Settings.SetBool("Measurement.Snapping.Objects.Use", False)
Call PDFEditor.Inst.Settings.SetBool("Measurement.Snapping.Objects.Use", True)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Unable to get the SnapToObject Settings to take effect  SOLVED

Post by Sasha - Tracker Dev Team »

Hello RMan,

Please try firing this event after the settings change:

Code: Select all

pdfCtl.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Measurement);
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Unable to get the SnapToObject Settings to take effect

Post by RMan »

Works Perfect!!! Thanks so much Sasha.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17906
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Unable to get the SnapToObject Settings to take effect

Post by Tracker Supp-Stefan »

:)
Post Reply