Remember Me?

#1
September 24th 20, 07:29 AM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Sep 2020 Posts: 9
Determine the end coordinates of an Arc and then add textbox

I am having trouble determining what the end position of an arc is. I would like to determine the coordinates of the end point or start point and then place a textbox or other shape at those same coordinates. Of the attributes of an arc - which describes the top and left of the end point? The top and left that I can obtain seem to provide the position of the top left corner of the bounding box/border of the shape - which may be far from the end point of the actual arc.

Thanks for any assistance with this question.

#2
September 24th 20, 11:58 AM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Jul 2019 Posts: 64
Determine the end coordinates of an Arc and then add textbox

"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is. I would
like to determine the coordinates of the end point or start point and then
place a textbox or other shape at those same coordinates. Of the attributes
of an arc - which describes the top and left of the end point? The top and
left that I can obtain seem to provide the position of the top left corner
of the bounding box/border of the shape - which may be far from the end
point of the actual arc.

Thanks for any assistance with this question.

======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T

#3
September 24th 20, 06:10 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Sep 2020 Posts: 9
Determine the end coordinates of an Arc and then add textbox

On Thursday, 24 September 2020 at 04:58:19 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is. I would
like to determine the coordinates of the end point or start point and then
place a textbox or other shape at those same coordinates. Of the attributes
of an arc - which describes the top and left of the end point? The top and
left that I can obtain seem to provide the position of the top left corner
of the bounding box/border of the shape - which may be far from the end
point of the actual arc.

Thanks for any assistance with this question.
======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T

Thanks Peter

I understand in theory what you are showing but I am having trouble getting it to work in practice

I have but together this but get an error at x1=ndstart.points(1,1) .... <Error 424 Object required

Dim nds As ShapeNodes
Dim ndStart As ShapeNode, ndEnd As ShapeNode

Set myArcShape = Worksheets("test").Shapes(1)

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.Count)

x1 = ndStart.Points(1, 1): y1 = ndStart.Points(1, 2)
x2 = ndStart.Points(1, 1): y2 = ndEnd.Points(1, 2)

Thoughts?? What is missing
#4
September 24th 20, 08:20 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Jul 2019 Posts: 64
Determine the end coordinates of an Arc and then add textbox

"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 04:58:19 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is. I
would
like to determine the coordinates of the end point or start point and
then
place a textbox or other shape at those same coordinates. Of the
attributes
of an arc - which describes the top and left of the end point? The top
and
left that I can obtain seem to provide the position of the top left
corner
of the bounding box/border of the shape - which may be far from the end
point of the actual arc.

Thanks for any assistance with this question.
======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T

Thanks Peter

I understand in theory what you are showing but I am having trouble
getting it to work in practice

I have but together this but get an error at x1=ndstart.points(1,1) ....
<Error 424 Object required

Dim nds As ShapeNodes
Dim ndStart As ShapeNode, ndEnd As ShapeNode

Set myArcShape = Worksheets("test").Shapes(1)

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.Count)

x1 = ndStart.Points(1, 1): y1 = ndStart.Points(1, 2)
x2 = ndStart.Points(1, 1): y2 = ndEnd.Points(1, 2)

Thoughts?? What is missing

Ah, I forgot, if the Arc (or any shape with freeform type nodes) hasn't had
its points manually edited need to trick it into thinking they have been.

A bit odd but try including this line which reapplies the first node's
exisiting editingtype property, then try returning the point coordinates:

nds.SetEditingType 1, ndStart.EditingType

However if you have manually edited the arc's points this probably won't
help!

Peter T

#5
September 24th 20, 09:10 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Sep 2020 Posts: 9
Determine the end coordinates of an Arc and then add textbox

On Thursday, 24 September 2020 at 13:20:17 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 04:58:19 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is. I
would
like to determine the coordinates of the end point or start point and
then
place a textbox or other shape at those same coordinates. Of the
attributes
of an arc - which describes the top and left of the end point? The top
and
left that I can obtain seem to provide the position of the top left
corner
of the bounding box/border of the shape - which may be far from the end
point of the actual arc.

Thanks for any assistance with this question.
======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T

Thanks Peter

I understand in theory what you are showing but I am having trouble
getting it to work in practice

I have but together this but get an error at x1=ndstart.points(1,1) ....
<Error 424 Object required

Dim nds As ShapeNodes
Dim ndStart As ShapeNode, ndEnd As ShapeNode

Set myArcShape = Worksheets("test").Shapes(1)

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.Count)

x1 = ndStart.Points(1, 1): y1 = ndStart.Points(1, 2)
x2 = ndStart.Points(1, 1): y2 = ndEnd.Points(1, 2)

Thoughts?? What is missing

Ah, I forgot, if the Arc (or any shape with freeform type nodes) hasn't had
its points manually edited need to trick it into thinking they have been.

A bit odd but try including this line which reapplies the first node's
exisiting editingtype property, then try returning the point coordinates:

nds.SetEditingType 1, ndStart.EditingType

However if you have manually edited the arc's points this probably won't
help!

Peter T

Thanks again Peter but the change still results in the same error. I place the suggested line immediately below Set nds = myArcShape.Nodes

#6
September 24th 20, 09:37 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Jul 2019 Posts: 64
Determine the end coordinates of an Arc and then add textbox

"David Cuthill" wrote in message
On Thursday, 24 September 2020 at 13:20:17 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 04:58:19 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is. I
would
like to determine the coordinates of the end point or start point and
then
place a textbox or other shape at those same coordinates. Of the
attributes
of an arc - which describes the top and left of the end point? The top
and
left that I can obtain seem to provide the position of the top left
corner
of the bounding box/border of the shape - which may be far from the
end
point of the actual arc.

Thanks for any assistance with this question.
======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T
Thanks Peter

I understand in theory what you are showing but I am having trouble
getting it to work in practice

I have but together this but get an error at x1=ndstart.points(1,1)
....
<Error 424 Object required

Dim nds As ShapeNodes
Dim ndStart As ShapeNode, ndEnd As ShapeNode

Set myArcShape = Worksheets("test").Shapes(1)

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.Count)

x1 = ndStart.Points(1, 1): y1 = ndStart.Points(1, 2)
x2 = ndStart.Points(1, 1): y2 = ndEnd.Points(1, 2)

Thoughts?? What is missing

Ah, I forgot, if the Arc (or any shape with freeform type nodes) hasn't
its points manually edited need to trick it into thinking they have been.

A bit odd but try including this line which reapplies the first node's
exisiting editingtype property, then try returning the point coordinates:

nds.SetEditingType 1, ndStart.EditingType

However if you have manually edited the arc's points this probably won't
help!

Peter T

Thanks again Peter but the change still results in the same error. I place
the suggested line immediately below Set nds = myArcShape.Nodes

If literally(?) "Immediately below" the 'Set nds =' line I'd expect you now
to get the error on the new 'SetEditingType' line because ndStart doesn't
refer to anythihng, so move it below the 'Set ndStart =' line or, as I
should have better clarified, just above lines that attempt to return the
points coordinates.

BTW - had the points ever been manually edited?

Peter T

#7
September 24th 20, 09:53 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Sep 2020 Posts: 9
Determine the end coordinates of an Arc and then add textbox

On Thursday, 24 September 2020 at 14:37:13 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
On Thursday, 24 September 2020 at 13:20:17 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 04:58:19 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is. I
would
like to determine the coordinates of the end point or start point and
then
place a textbox or other shape at those same coordinates. Of the
attributes
of an arc - which describes the top and left of the end point? The top
and
left that I can obtain seem to provide the position of the top left
corner
of the bounding box/border of the shape - which may be far from the
end
point of the actual arc.

Thanks for any assistance with this question.
======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T
Thanks Peter

I understand in theory what you are showing but I am having trouble
getting it to work in practice

I have but together this but get an error at x1=ndstart.points(1,1)
....
<Error 424 Object required

Dim nds As ShapeNodes
Dim ndStart As ShapeNode, ndEnd As ShapeNode

Set myArcShape = Worksheets("test").Shapes(1)

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.Count)

x1 = ndStart.Points(1, 1): y1 = ndStart.Points(1, 2)
x2 = ndStart.Points(1, 1): y2 = ndEnd.Points(1, 2)

Thoughts?? What is missing
Ah, I forgot, if the Arc (or any shape with freeform type nodes) hasn't
its points manually edited need to trick it into thinking they have been.

A bit odd but try including this line which reapplies the first node's
exisiting editingtype property, then try returning the point coordinates:

nds.SetEditingType 1, ndStart.EditingType

However if you have manually edited the arc's points this probably won't
help!

Peter T

Thanks again Peter but the change still results in the same error. I place
the suggested line immediately below Set nds = myArcShape.Nodes

If literally(?) "Immediately below" the 'Set nds =' line I'd expect you now
to get the error on the new 'SetEditingType' line because ndStart doesn't
refer to anythihng, so move it below the 'Set ndStart =' line or, as I
should have better clarified, just above lines that attempt to return the
points coordinates.

BTW - had the points ever been manually edited?

Peter T

Thanks - the placement of the line made the difference and it is working. I did manipulate manually the "angle" of the arc before running the code and it still works. It looks like the set editing type removes the ability to manipulate the angle of the endpoints of the arc and attempting to edit the points afterward then the shape is no longer considered an arc - which is okay as it just needed to be static after this manipulation.
#8
September 24th 20, 10:08 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Jul 2019 Posts: 64
Determine the end coordinates of an Arc and then add textbox

"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 14:37:13 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
On Thursday, 24 September 2020 at 13:20:17 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 04:58:19 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is.
I
would
like to determine the coordinates of the end point or start point
and
then
place a textbox or other shape at those same coordinates. Of the
attributes
of an arc - which describes the top and left of the end point? The
top
and
left that I can obtain seem to provide the position of the top left
corner
of the bounding box/border of the shape - which may be far from the
end
point of the actual arc.

Thanks for any assistance with this question.
======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T
Thanks Peter

I understand in theory what you are showing but I am having trouble
getting it to work in practice

I have but together this but get an error at x1=ndstart.points(1,1)
....
<Error 424 Object required

Dim nds As ShapeNodes
Dim ndStart As ShapeNode, ndEnd As ShapeNode

Set myArcShape = Worksheets("test").Shapes(1)

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.Count)

x1 = ndStart.Points(1, 1): y1 = ndStart.Points(1, 2)
x2 = ndStart.Points(1, 1): y2 = ndEnd.Points(1, 2)

Thoughts?? What is missing
Ah, I forgot, if the Arc (or any shape with freeform type nodes) hasn't
its points manually edited need to trick it into thinking they have
been.

A bit odd but try including this line which reapplies the first node's
exisiting editingtype property, then try returning the point
coordinates:

nds.SetEditingType 1, ndStart.EditingType

However if you have manually edited the arc's points this probably
won't
help!

Peter T

Thanks again Peter but the change still results in the same error. I
place
the suggested line immediately below Set nds = myArcShape.Nodes

If literally(?) "Immediately below" the 'Set nds =' line I'd expect you
now
to get the error on the new 'SetEditingType' line because ndStart doesn't
refer to anything, so move it below the 'Set ndStart =' line or, as I
should have better clarified, just above lines that attempt to return the
points coordinates.

BTW - had the points ever been manually edited?

Peter T

Thanks - the placement of the line made the difference and it is working. I
did manipulate manually the "angle" of the arc before running the code and
it still works. It looks like the set editing type removes the ability to
manipulate the angle of the endpoints of the arc and attempting to edit the
points afterward then the shape is no longer considered an arc - which is
okay as it just needed to be static after this manipulation.

============
If by "angle of the arc" you mean "angle of the shape" that's not the same
as editing the points.

PT

#9
September 24th 20, 10:59 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Sep 2020 Posts: 9
Determine the end coordinates of an Arc and then add textbox

On Thursday, 24 September 2020 at 15:08:15 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 14:37:13 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
On Thursday, 24 September 2020 at 13:20:17 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
...
On Thursday, 24 September 2020 at 04:58:19 UTC-6, Peter T wrote:
"David Cuthill" wrote in message
I am having trouble determining what the end position of an arc is.
I
would
like to determine the coordinates of the end point or start point
and
then
place a textbox or other shape at those same coordinates. Of the
attributes
of an arc - which describes the top and left of the end point? The
top
and
left that I can obtain seem to provide the position of the top left
corner
of the bounding box/border of the shape - which may be far from the
end
point of the actual arc.

Thanks for any assistance with this question.
======================

The Arc is described by its Nodes collection, air code -

Dim nds As ShapeNodes
Dim ndStart as ShapeNode, ndEnd as ShapeNode

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.count)

x1 = ndStart.Points(1,1) : y1 = ndStart.Points(1,2)
x2 = ndStart.Points(1,1) : y2 = ndEnd.Points(1,2)

Peter T
Thanks Peter

I understand in theory what you are showing but I am having trouble
getting it to work in practice

I have but together this but get an error at x1=ndstart.points(1,1)
....
<Error 424 Object required

Dim nds As ShapeNodes
Dim ndStart As ShapeNode, ndEnd As ShapeNode

Set myArcShape = Worksheets("test").Shapes(1)

Set nds = myArcShape.Nodes
Set ndStart = nds(1)
Set ndEnd = nds(nds.Count)

x1 = ndStart.Points(1, 1): y1 = ndStart.Points(1, 2)
x2 = ndStart.Points(1, 1): y2 = ndEnd.Points(1, 2)

Thoughts?? What is missing
Ah, I forgot, if the Arc (or any shape with freeform type nodes) hasn't
its points manually edited need to trick it into thinking they have
been.

A bit odd but try including this line which reapplies the first node's
exisiting editingtype property, then try returning the point
coordinates:

nds.SetEditingType 1, ndStart.EditingType

However if you have manually edited the arc's points this probably
won't
help!

Peter T

Thanks again Peter but the change still results in the same error. I
place
the suggested line immediately below Set nds = myArcShape.Nodes

If literally(?) "Immediately below" the 'Set nds =' line I'd expect you
now
to get the error on the new 'SetEditingType' line because ndStart doesn't
refer to anything, so move it below the 'Set ndStart =' line or, as I
should have better clarified, just above lines that attempt to return the
points coordinates.

BTW - had the points ever been manually edited?

Peter T

Thanks - the placement of the line made the difference and it is working. I
did manipulate manually the "angle" of the arc before running the code and
it still works. It looks like the set editing type removes the ability to
manipulate the angle of the endpoints of the arc and attempting to edit the
points afterward then the shape is no longer considered an arc - which is
okay as it just needed to be static after this manipulation.
============
If by "angle of the arc" you mean "angle of the shape" that's not the same
as editing the points.

PT

Peter

I don't me the angle of rotation of the shape but rather when you edit the endpoint points position of an arc you are changing the angle (or at least that is the way I understand it).

I captured an image of what I mean in order to make my point clear but I can't see how to upload it.

thank you

David

#10
September 25th 20, 08:45 AM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Jul 2019 Posts: 64
Determine the end coordinates of an Arc and then add textbox

"David Cuthill" wrote in message
[snip]

Thanks again Peter but the change still results in the same error. I
place
the suggested line immediately below Set nds = myArcShape.Nodes
If literally(?) "Immediately below" the 'Set nds =' line I'd expect you
now
to get the error on the new 'SetEditingType' line because ndStart
doesn't
refer to anything, so move it below the 'Set ndStart =' line or, as I
should have better clarified, just above lines that attempt to return
the
points coordinates.

BTW - had the points ever been manually edited?

Peter T

Thanks - the placement of the line made the difference and it is working.
I
did manipulate manually the "angle" of the arc before running the code
and
it still works. It looks like the set editing type removes the ability to
manipulate the angle of the endpoints of the arc and attempting to edit
the
points afterward then the shape is no longer considered an arc - which is
okay as it just needed to be static after this manipulation.
============
If by "angle of the arc" you mean "angle of the shape" that's not the
same
as editing the points.

PT

Peter

I don't me the angle of rotation of the shape but rather when you edit the
endpoint points position of an arc you are changing the angle (or at least
that is the way I understand it).

I captured an image of what I mean in order to make my point clear but I
can't see how to upload it.

thank you

David

Ah, it's confusing as that is yet a third way of editing the arc/shape. But
if I understand correctly that's not 'edit points'. In most Excel versions
right click the shape and "Edit Points". In 365 and 2019, select the shape,
on the Ribbon, Shape Format / Insert Shapes / Edit Shape / Edit Points.

PT

 Posting Rules Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On

 Similar Threads Thread Thread Starter Forum Replies Last Post Eric Excel Discussion (Misc queries) 4 August 5th 07 07:27 PM lakem Excel Programming 2 November 15th 06 09:02 PM willem Excel Programming 0 August 8th 06 03:33 PM Dan[_38_] Excel Programming 8 July 11th 04 04:54 PM Steve[_50_] Excel Programming 3 December 2nd 03 07:48 PM

All times are GMT +1. The time now is 01:46 PM.