selected face should come parallel to display programatically.

selected face should come parallel to display programatically.

Anonymous
Not applicable
680 Views
5 Replies
Message 1 of 6

selected face should come parallel to display programatically.

Anonymous
Not applicable

Hi everybody,

 

I have a part,in that part i will select randomly one face then that selected face should come parallel to display programatically.Please someone help me how to do this as soon as possible.

 

thanks in andvance

  yogesh.s

0 Likes
Accepted solutions (1)
681 Views
5 Replies
Replies (5)
Message 2 of 6

kennyj
Collaborator
Collaborator

Yogeshs9739,

 

LookAt is the command I think you want.  Choose the LookAt icon (under the view cube by default).  Also hot key "Page Up".  Then any surface you select, it will align with the display.

 

Hope that helps.

 

Kenny

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks  for soon replay ,but i want to achieve through programing can you help me for that.

0 Likes
Message 4 of 6

frederic.vandenplas
Collaborator
Collaborator
Accepted solution

Hi,

 

I've tested this in part environment and works on planarfaces in vba

 

Sub LookAtSelectedFace()

    Dim oDoc As document
    Set oDoc = ThisApplication.ActiveDocument
  
    Dim oSelSet As SelectSet
    Set oSelSet = oDoc.SelectSet
    
    Dim oFace As Face
    Set oFace = ThisApplication.CommandManager.Pick(kPartFacePlanarFilter, "Select a face.")
            
    If oFace Is Nothing Then
        Exit Sub
    Else
        Call oSelSet.Select(oFace)
    End If
    Dim oCommandMgr As CommandManager
    Set oCommandMgr = ThisApplication.CommandManager

    Dim oControlDef As ControlDefinition
    Set oControlDef = oCommandMgr.ControlDefinitions.Item("AppLookAtCmd")
    
    Call oControlDef.Execute
    
End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 5 of 6

LukeDavenport
Collaborator
Collaborator
Hi,
You should investigate running the standard Inventor 'Look at Face'
command, perhaps using the CommandManager.
Luke
Message 6 of 6

Anonymous
Not applicable

thanks ,it is working fine ..

0 Likes