SURFACE IDENTIFICATION, GEOMETRY FORM AND CHANGE TYPE

SURFACE IDENTIFICATION, GEOMETRY FORM AND CHANGE TYPE

Anonymous
Not applicable
839 Views
4 Replies
Message 1 of 5

SURFACE IDENTIFICATION, GEOMETRY FORM AND CHANGE TYPE

Anonymous
Not applicable

HI,  im working in a program to mate a sphere to any kind of surface but i found a problem with the constraint command, when i try to mate the sphere with some parts of a surface the mate constraint does not recognize it, i think is the geometry form type because the constraint only works with the surfaces that are type 9.

 

i wonder if there is a way to chance the surface type or it would be great if someone could explain me what this numbers of geometry form mean

 

the next code returns the geometryform type in a message box.

 

 

 

Imports

System

Imports

System.Type

Imports

System.Activator

Imports

System.Runtime.InteropServices Imports

Inventor Imports

System.Math

Public

ClassForm1

   

Public _invApp As Inventor.Application     

Dim _started AsBoolean                    

Dim boton AsBoolean

   

PublicSub ShowSaveAsDialog()

   

EndSub

   

PrivateSub add_clamp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

 

 

        InitializeComponent()

 

       

Try

            _invApp =

Marshal.GetActiveObject("Inventor.Application")

       

Catch ex AsException

           

Try

               

Dim invAppType AsType = _

                  GetTypeFromProgID(

"Inventor.Application")

                _invApp = CreateInstance(invAppType)

                _invApp.Visible =

True

                _started =

True

           

Catch ex2 AsException

                MsgBox(ex2.ToString())

                MsgBox(

"ERROR 001")

           

EndTry

       

EndTry

 

otravez:

       

Dim Superficie AsNewObject

        Superficie = _invApp.CommandManager.Pick(

SelectionFilterEnum.kAllEntitiesFilter, "Select point")

        MsgBox(

"superficie tipo: " & Superficie.geometryform.ToString)

       

GoTo otravez

   

EndSub

End

Class

 

0 Likes
840 Views
4 Replies
Replies (4)
Message 2 of 5

philippe.leefsma
Alumni
Alumni

Hi

 

I have trouble understanding what you are talking about ... mate constraint can only be created between certain surface types. You can't just change a surface typw without changing the surface itself.

 

Please take a look at the AddMateConstraint method in the API Help Files:

 

Method that creates a new mate assembly constraint. The two input entities can be a combination of planar faces, linear edges, vertices, cylindrical faces, conical faces, spherical faces, revolved faces, work planes, work axes, and work points. When a cylindrical, conical, or revolved face is input, the axis of the surface is used for the constraint. When a sphere is input, the center point of the sphere is used for the constraint. To use the surface of a cylindrical, conical, or spherical face use the EntityOneInferredType or EntityTwoInferredType arguments.

 

I hope it helps,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks, actually I use the addmateconstraint method and when i used it i realize the problem that i can not mate the center of the sphere in some parts of the surface, and now i am placing the sphere manually near in the position of the surface that i need, so what i trying to do is find some way to do this with just on click in the surface.

 

thanks for your response

 

0 Likes
Message 4 of 5

philippe.leefsma
Alumni
Alumni

So if I understand correctly, you now just want to run a command to insert the sphere on the surface? You can create a custom command that will prompt the user to select a surface and then run any logic want using the API...

 

Take a look at InteractionEvents Object in the help files, there are samples illustrating its use, for example "Basic Selection Using Interaction Events API Sample".

 

Hope this helps,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

Anonymous
Not applicable

Ok, I haven't tried that topic in the help part, i going to check it out, as soon as I get a result i'll post it

 

Thanks!!

0 Likes