Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SketchLine Gemoetry Wrong Results

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
mario.lung
329 Views, 3 Replies

SketchLine Gemoetry Wrong Results

Hi,

 

i draw a Sketch Line and debug the Start and EndPoint Coordinates

 

...

    Dim oStartPoint
    Dim oEndPoint
    
    Dim oSketch As PlanarSketch
    Set oSketch = oCompDef.Sketches(1)
                                
    Dim oSketchLine As SketchLine
    For Each oSketchLine In oSketch.SketchLines
        
        Dim dCoordinates(2) As Double
        
        Call oSketchLine.Geometry.StartPoint.GetPointData(dCoordinates)
        Debug.Print "StartPoint = " & dCoordinates(0) & ", " & dCoordinates(1)
       
        Call oSketchLine.Geometry.EndPoint.GetPointData(dCoordinates)
        Debug.Print "EndPoint = " & dCoordinates(0) & ", " & dCoordinates(1)
        
       Debug.Print "---"
        
    Next

 The Results is

 


StartPoint = 1.11022302462516E-16, 4.49956402428943
EndPoint = 2.00100803964792, 4.49956402428943

 

when i look in the Drawing is the Result

 

21.01.png

 

so my Problem is when i draw a Line with the Coordinates there i get its the Line Diffrent to the Original Line!

 

ths for Hints Tips or Solutions

 

Mario

 

 

3 REPLIES 3
Message 2 of 4
Jon.Dean
in reply to: mario.lung

I have asked one of the ADN experts to comment on this.

Jon



Jon Dean

Message 3 of 4
ekinsb
in reply to: mario.lung

The picture is too small to be able to see what's going on.  How are you drawing the second line; using the API or interactively?  The coordinates returned when you query the start and end points are 2D coordinates in sketch space and in centimeters.  Depending on how you're drawing the second line it might be in different units, in model space, or in the space of a different sketch.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 4 of 4
mario.lung
in reply to: ekinsb

Hey,

 

I have now the Result

 

when i dosent editclose or update the Document

the Result is wrong

 

after this the resoults are rigth!

 

thx for Help

 

Mario

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

Post to forums  

Autodesk Design & Make Report