Inventor Engineer-to-Order

Inventor Engineer-to-Order

Reply
Active Contributor
WHassan
Posts: 32
Registered: ‎07-17-2012
Message 1 of 3 (176 Views)
Accepted Solution

Extracting co-ordinates of a Point

176 Views, 2 Replies
11-19-2012 02:59 PM

Hello all,

 

I am trying to get the X-coordinate of a point.

 

The code goes something like this;

 

 

Rule lstStdPanelParameters As List

 

    Dim counter1 AsInteger

    For counter1 = 1 To intNoStdPanels

     lstStdPanelParameters = lstStdPanelParameters + {{ _

              ":smileysurprised:rigin", Point(counter1 * numStdPanelLength,0,0), _

              ":xDirection", Vector(0, 0, 1)), _

              ":yDirection", Vector(-1,0,0)}}

    Next

 

End Rule

 

 

The value I need in a spearate rule would be something like;

 

Rule pntFirstPanelOrigin As Point = Second( First _

( lstStdPanelParameters))

 

Rule intOriginX As Number  = pntFirstPanelOrigin.x

 

I get an error when I evaluate this (last) rule, saying "Found a Point, where a Part was expected"

 

 

I also get the same error if I use a child (for example)

 

 

Rule intOrigin2X As Number = myChildName.origin.x

 

 

Support for all the helpers is approaciated.

 

Thanking you,

 

Wajih

 

Employee
ebachrach
Posts: 44
Registered: ‎09-11-2007
Message 2 of 3 (165 Views)

Re: Extracting co-ordinates of a Point

11-19-2012 08:45 PM in reply to: WHassan

Hi,

the function localx(origin) should give you the value you are looking for.

Elly


--
Autodesk
Elly Bachrach
Solutions Architect
Autodesk Global Services
Direct +1 (847) 676-2880
elly.bachrach@autodesk.com

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Mentor
FarrenYoung
Posts: 264
Registered: ‎07-13-2009
Message 3 of 3 (140 Views)

Re: Extracting co-ordinates of a Point

11-26-2012 07:23 AM in reply to: WHassan

There are also hidden functions GetX(), GetY(), and GetZ() which you might find useful.  I believe localX() will convert the point relative to a coordinate system and GetX() will get the x value and not do any conversion.  Someone can correct me if i'm wrong.

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.