Configuration of POLY NUDGE TOOL . . .
2018-02-27-171525
All --
I am writing a PREMIER APP that can benefit from the availability of the POLY NUDGE TOOL.
I know from my previous use of this TOOL in an APP that CODE can ACTIVATE and DEACTIVATE this TOOL and that an POLYGON or POLYLINE must be UNLOCKED before this TOOL will ACTIVATE but . . .
Is there a way to change the RADIUS of this TOOL?
I have looked in the HELP FILE and there does not seem to be a way to do this from the GUI so I cannot record this action as a guide.
Thank you in advance for your assistance with this query.
-- Matt
All --
I am writing a PREMIER APP that can benefit from the availability of the POLY NUDGE TOOL.
I know from my previous use of this TOOL in an APP that CODE can ACTIVATE and DEACTIVATE this TOOL and that an POLYGON or POLYLINE must be UNLOCKED before this TOOL will ACTIVATE but . . .
Is there a way to change the RADIUS of this TOOL?
I have looked in the HELP FILE and there does not seem to be a way to do this from the GUI so I cannot record this action as a guide.
Thank you in advance for your assistance with this query.
-- Matt
0
Best Answer
-
Hi Matt,
The Nudge tool will be enabled when Select mode is active and a polygonal measurement object is selected. It can be activated by ToggleEditToolNudge command. Here is a sample macro that also sets the size:Public Sub ToggleNudgeTool With ThisApplication.Commands("Select.Image.ToggleEditToolNudge") Debug.Print "Nudge tool was active = " & .Checked.ToString .Run()'toggle tool If Not .Checked Then 'set size Dim tool As MediaCy.IQL.Display.Overlays.IMcGraphToolServer=ThisApplication.ActiveImage.MeasurementsData.Overlay.ActiveTool tool.CommandData=100'diameter of the Nudge tool in pixels tool.CommandFlags(0)=MediaCy.IQL.Display.Overlays.mcSelectToolCommandFlags.mcstcfSetPolyNudgeToolSize End If End With End Sub
Yuri0
Answers
Yuri --
Thank you for your response and the CODE it contains.
This looks perfect for the challenge at hand.
I'll be working on this APP today and tomorrow and will wire this in.
Thanks again.
-- Matt
Yuri --
I created an EDIT BUTTON in an APP and then added your CODE to the PROJECT as shown below.
I can LOAD the PROJECT with no errors and when I press the EDIT BUTTON with an image open with an AUTO CREATED REGION on the image, the NUDGE TOOL (adjusted to 100) works like a champ.
Unfortunately sometimes the error shown below is displayed when the EDIT BUTTON is pressed
This is again with an image and a AUTO CREATED REGION on the image.
The PREMIER APPLICATION INFO from SYSTEM INFORMATION is:
This FILE VERSION INFO is a bit at odds with the ABOUT for PREMIER shown below.
Will you please suggest a solution for this issue?
Also . . .
Is there a way to GET the NUDGE TOOL DIAMETER before I SET the NUDGE TOOL DIAMETER so that I can reset it to the NORMAL SIZE when the APP is finished with the NUDGE TOOL?
I tried using
MediaCy.IQL.Display.Overlays.mcSelectToolCommandFlags.mcstcfGetPolyNudgeToolSize
but this did not return a reasonable value. It looks like some kind of handle value.
Thanks.
-- Matt
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Nudge tool can be activated only when you have ONE feature selected, when yu have multiple, then you get such error. I've modified the macro adding this test:
There is a bug getting current Nudge tool size by mcstcfGetPolyNudgeToolSize (we are looking at that), so, for now, you can just assume that the tool has default size of 12.
Yuri
Yuri --
Thank you for your valuable assistance.
I am surprised that PREMIER is acting as though there is more than one feature selected. The path the image takes before the EDIT is set up to discard all but the largest feature. There must be something hiding someplace.
I will work with your revised code and my code that leads up to it and see if I can identify and eliminate the MULTIPLE SELECTED ISSUE before activating the POLY NUDGE TOOL.
I will use the POLY NUDGE TOOL SIZE = 12 to RESET the when the CODE is finished with it.
Thanks again.
-- Matt
Yuri --
After playing with this EDIT function a bit more, I think the ERROR may be being generated by the PREMIER thinking that NO FEATURES are SELECTED.
I re-engineered things a bit and put a short pause in after the UNLOCK and now the EDIT CODE seems to work reliably and it puts the DIAMETER back to the DEFAULT VALUE (12).
Thank you very much for your guidance.
-- Matt
Yuri --
In an unrelated but related question . . .
I like the way the CODE you generated for the POLY NUDGE TOOL turns the TOOL on and off.
Is there a way to access and control the POLYGON MEASUREMENT TOOL in the same way you accessed and controlled the POLY NUDGE TOOL?
I have a DRAW FEATURE ROUTINE (below) that works well but it uses a PROMPT BALLOON and it would be nice if the tool was turned on and then off by the same button within the UI for the APP.
Thanks in advance.
-- Matt
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Yuri --
In the CODE above for the control of the POLY NUDGE TOOL, there are references to changing the SIZE / DIAMETER of the TOOL.
The CODE you provided change the SIZE but it seems to be the RADIUS of the TOOL rather than the DIAMETER.
I hope this information is helpful to others here in the FORUM and we appreciate your guidance and assistance.
-- Matt