Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2024, 06:50 AM
IndianaITGuy IndianaITGuy is offline How to determine what is at a particular cursor location Windows 11 How to determine what is at a particular cursor location Office 2019
Novice
How to determine what is at a particular cursor location
 
Join Date: Mar 2024
Location: Martinsville, IN
Posts: 25
IndianaITGuy is on a distinguished road
Default How to determine what is at a particular cursor location

Attached is a sample file. They are groups of X & Y coordinates. These groups seem to be bracketed between ";PATH:" and "G00 Z4.^pA0." I'm having trouble conceptualizing an approach to a DO-WHILE to perform operations between those two endpoints.



The file represents X, Y, Z, A, and C coordinates in a 5-Axis system. I need to switch the X and Y coordinates only. I need to switch the X and Y values and then move them back to their correct relative positions.

So X-1.8721 Y-1.5709 becomes X-1.5709 Y-1.8721

X-1.571
Y-20.3033 Z7.802 F80. A-.761
Y-19.7012 Z7.7895 A-1.525 C-3.776
Y-19.0993 Z7.769 A-2.288
Y-18.4977 Z7.7405 A-3.051
.
.
.

becomes

Y-1.571
X-20.3033 Z7.802 F80. A-.761
X-19.7012 Z7.7895 A-1.525 C-3.776
X-19.0993 Z7.769 A-2.288
X-18.4977 Z7.7405 A-3.051
.
.
.


Y1.571
X-20.3033 Z7.802 F80. A-.761 C-90.
X-19.7012 Z7.7895 A-1.525 C-93.776
X-19.0993 Z7.769 A-2.288
X-18.4977 Z7.7405 A-3.051
X-17.8965 Z7.704 A-3.813
.
.
.


Becomes

X1.571
Y-20.3033 Z7.802 F80. A-.761 C-90.
Y-19.7012 Z7.7895 A-1.525 C-93.776
Y-19.0993 Z7.769 A-2.288
Y-18.4977 Z7.7405 A-3.051
Y-17.8965 Z7.704 A-3.813
.
.
.
Attached Files
File Type: docx Paul - Sample Code2.docx (22.0 KB, 2 views)
Reply With Quote
  #2  
Old 03-27-2024, 07:23 AM
Italophile Italophile is offline How to determine what is at a particular cursor location Windows 11 How to determine what is at a particular cursor location Office 2021
Expert
 
Join Date: Mar 2022
Posts: 338
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

There is no need for a loop. This can be achieved with a simple 3 stage Find and Replace.
  1. Replace X- with YX-
  2. Replace Y- with X-
  3. Replace YX- with Y-
Reply With Quote
  #3  
Old 03-27-2024, 07:39 AM
IndianaITGuy IndianaITGuy is offline How to determine what is at a particular cursor location Windows 11 How to determine what is at a particular cursor location Office 2019
Novice
How to determine what is at a particular cursor location
 
Join Date: Mar 2024
Location: Martinsville, IN
Posts: 25
IndianaITGuy is on a distinguished road
Default

The (-) is the negative sign in front of the coordinate. I can't simply search for Xs & Ys.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine what is at a particular cursor location Protected Word Document Open Cursor Location data808 Word VBA 9 10-14-2022 01:06 AM
Determine Style of paragraph at current location exoson Word VBA 2 01-25-2022 11:15 AM
How to determine what is at a particular cursor location Cursor location on first click -- insertion point stevec5088 Word 1 12-14-2016 02:45 PM
determine location of object via calculation sarahtalbot Visio 0 01-08-2015 03:27 AM
How to determine what is at a particular cursor location Hightlight cells based on cursor location megads Excel Programming 2 07-31-2014 06:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft