• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor Engineer-to-Order

    Reply
    Active Contributor
    Posts: 26
    Registered: ‎07-17-2012
    Accepted Solution

    Extracting co-ordinates of a Point

    110 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

     

    Please use plain text.
    Employee
    Posts: 26
    Registered: ‎09-11-2007

    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
    Please use plain text.
    Mentor
    FarrenYoung
    Posts: 246
    Registered: ‎07-13-2009

    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"
    ************************************************************************************
    Please use plain text.