Inventor 2011 V 2012

Inventor 2011 V 2012

Anonymous
Not applicable
420 Views
2 Replies
Message 1 of 3

Inventor 2011 V 2012

Anonymous
Not applicable

I managed to write some code in Inventor 2011 to produce a part which left the part finished (as after clicking 'Finish Sketch' when making a part normally) using ThisApplication.ActiveView.Fit and Go Home commands.  Now when I run the same code in 2012 it stops before finishing the code and I have to obviously click Finish Sketch to complete the part.  Is there a way round this. I think Ive seen messages saying certain things arent supported in 2012 which seems a shame..  Kind Regards Dave F

0 Likes
Accepted solutions (1)
421 Views
2 Replies
Replies (2)
Message 2 of 3

YuhanZhang
Autodesk
Autodesk
Accepted solution

I have not an idea that how you can use the ActiveView.Fit and Go Home command to exit the sketch edit mode, but you can use below sample code to exit the sketch edit mode:

 

    Dim oActiveObj As Object
    Set oActiveObj = ThisApplication.ActiveEditObject
    
    If oActiveObj.Type = kPlanarSketchObject Then
        oActiveObj.ExitEdit
    End If

 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi Rocky. Many Thanks for that, yes it did end the sketch process ( in 2012 ! ).  I was just looking at an example in the programming help which I hope I can tweak  regarding sketch edit orientation as I would like to orient the finished part so I can see a 'three quarter' view.  Kind Regards Dave

0 Likes