.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Polyline question

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
307 Views, 6 Replies

Polyline question

I have a Polyline (plain one, not 2d or 3d) and I want to modify it by
adding some more vertices to into it. The vertices that I want to add
are all in WCS. How can I do this?

The AddVertexAt() method takes points in ECS, so I can't use that. The
SetPointAt() - which is not really setting a vertex - also takes point
in ECS. I am really stumped - I am newbie to ARX API but experienced in
programming otherwise. Can someone help me out - I will really
appreciate any help.

Thanks!
6 REPLIES 6
Message 2 of 7
foruma000256
in reply to: Anonymous

ECS is the entity's coordinate system based on its 3D Normal and base point.
What you need to do is convert your ECS vector3D object to the WCS vector3D, and all your math along the way.

You can use vector3D addition (not very familiar with that yet, but it should be the best way to go) or the hard way:

Dim matM As Matrix3d = Matrix3d.Displacement(New Vector3d(br.Position.GetAsVector.ToArray))

Study up on Vector3D object, that is what applies here.

jvj
Message 3 of 7
Anonymous
in reply to: Anonymous

jamievjohnson wrote:
> ECS is the entity's coordinate system based on its 3D Normal and base point.
> What you need to do is convert your ECS vector3D object to the WCS vector3D, and all your math along the way.
>
> You can use vector3D addition (not very familiar with that yet, but it should be the best way to go) or the hard way:
>
> Dim matM As Matrix3d = Matrix3d.Displacement(New Vector3d(br.Position.GetAsVector.ToArray))
>
> Study up on Vector3D object, that is what applies here.
>
> jvj

Thanks for the quick response. No kidding - but why does this have to be
so complicated? I guess modifying a Polyline to add vertices or to
create a a new one with vertices must be a very common operation in CAD
land - is there really no other way of doing it? Meanwhile I will look
up vector transformation as you suggested but will appreciate if someone
can point me to a sample code to do this. Thanks!
Message 4 of 7
Anonymous
in reply to: Anonymous

jamievjohnson wrote:
> ECS is the entity's coordinate system based on its 3D Normal and base point.
> What you need to do is convert your ECS vector3D object to the WCS vector3D, and all your math along the way.
>
> You can use vector3D addition (not very familiar with that yet, but it should be the best way to go) or the hard way:
>
> Dim matM As Matrix3d = Matrix3d.Displacement(New Vector3d(br.Position.GetAsVector.ToArray))
>
> Study up on Vector3D object, that is what applies here.
>
> jvj

I found a global ObjectARX function acdbWcs2Ecs() function that I think
I can use readily to perform the WCS to ECS transformations. Is there
any .NET equivalent of it?
Message 5 of 7
Anonymous
in reply to: Anonymous

None of what you describe below is is necessary.

Perhaps you should try studying the Matrix3d struct, and Point3d.TransformBy().

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

wrote in message news:5890621@discussion.autodesk.com...
ECS is the entity's coordinate system based on its 3D Normal and base point.
What you need to do is convert your ECS vector3D object to the WCS vector3D, and all your math along the way.

You can use vector3D addition (not very familiar with that yet, but it should be the best way to go) or the hard way:

Dim matM As Matrix3d = Matrix3d.Displacement(New Vector3d(br.Position.GetAsVector.ToArray))

Study up on Vector3D object, that is what applies here.

jvj
Message 6 of 7
Anonymous
in reply to: Anonymous

You can transform coordinates (Point3d) into the Ecs using the Matrix returned by the Ecs property and Point3d.TransformBy(). You can go in the other direction using the Inverse() of the matrix.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

"Gagan Gajabaharia" wrote in message news:5890637@discussion.autodesk.com...
jamievjohnson wrote:
> ECS is the entity's coordinate system based on its 3D Normal and base point.
> What you need to do is convert your ECS vector3D object to the WCS vector3D, and all your math along the way.
>
> You can use vector3D addition (not very familiar with that yet, but it should be the best way to go) or the hard way:
>
> Dim matM As Matrix3d = Matrix3d.Displacement(New Vector3d(br.Position.GetAsVector.ToArray))
>
> Study up on Vector3D object, that is what applies here.
>
> jvj

I found a global ObjectARX function acdbWcs2Ecs() function that I think
I can use readily to perform the WCS to ECS transformations. Is there
any .NET equivalent of it?
Message 7 of 7
Anonymous
in reply to: Anonymous

Tony Tanzillo wrote:
> You can transform coordinates (Point3d) into the Ecs using the Matrix returned by the Ecs property and Point3d.TransformBy(). You can go in the other direction using the Inverse() of the matrix.
>
Thank you, Tony. I will try it out today. Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost