Create RefPlane in Assembly

Valued Contributor
Valued Contributor

 

Dear Jason, I want to create a refplane by 3 points, could you tell me what mean of the parameters?

AsmRefPlane^ AddBy3Points( [InAttribute] Object^ RootPoint, [InAttribute] Object^ SecondXAxisPoint, [InAttribute] Object^ ThirdPoint

RootPoint , SecondXAxisPoint and Third Point is SolidEdgeGeometry::Vertex or other?

 AssemblyFeaturesHoleAdd(

uintnNumScopeParts,

refArraypScopeParts,

uintnNumProfiles,

refArraypProfiles,

refFeaturePropertyConstantspExtentSide,

ObjectpHoledata,

FeaturePropertyConstantsExtentType,

refdoublepHoleDepth,

ObjectpFromSurfOrPlane,

ObjectpToSurfOrPlane,

ObjectpKeyPoint,

refKeyPointExtentConstantspKeyPointFlags

)I want to create 2 holes in the same diameter and on the same plane.Could you tell me how many profile I will create?

Thanks!

 

Posted by: assassin 007
Post date: 5/18/2009 9:06:38 AM

13 REPLIES

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

Anybody can help me ? Thanks!

 

Posted by: assassin 007
Post date: 5/18/2009 4:57:09 PM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

 

Someone else asked me this before in the SE newsgroup.

Find attached an example (VBNet 2005).

The VB project is called "agujeros" which means "holes" in Spanish,  but don't worry, the comments in the code are in English.

Regards,

Julian

 

Posted by: Julian Guillo
Post date: 5/19/2009 8:10:00 AM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

Dear Julian, thank you very much! Do you know how to add a profile in assembly document and how to create a local refplane in assembly document? I have slected a face of a part, a edge of the face, and a vertex of the edge by mouse.

 

Posted by: assassin 007
Post date: 5/20/2009 7:26:42 AM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

 

Try the example attached.(VBNet 2005)

There is an asm file with one part to test. (ST version)

See the comments in the code.

Regards,

Julian

 

Posted by: Julian Guillo
Post date: 5/20/2009 12:52:37 PM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

Dear Julian, thanks! I've create the plane, but the result is different with your program. I don't know the reason, the origin is the default, but the origin is the point you selected by your program. By the way, could you tell me what mean of parameter of the function of AssemblyFeaturesHoles->Add()? Thank you very much!

 

Posted by: assassin 007
Post date: 5/27/2009 12:07:22 AM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

 

I don't understand very well the problem with your origin.

You told me that in your program you selected one face, one edge, and one vertex.

In my example i used:

        'Face: The 2nd face i find in the model. (I don't know what it is)

        oFace1 = ocu.OccurrenceDocument.models(1).body.faces(FeatureTopologyQueryTypeConstants.igQueryPlane).item(2)

        'Edge: The 1st edge i find in that face

        oEdge = oFace1.Edges.item(1)

       'Vertex: the start vertex of the edge i found.

        oVertex = oEdge.StartVertex

You should NOT be using any of these 3 objects i'm using (it's only an example).

You just must use the 3 objects you obtained clicking with your mouse.Also, the orientation for the created plane is a constant (igNormalSide, igReverseNormalSide).Depending on the face and edge selection the result could change. You can't know it until the plane is created.

Now, for AssemblyFeaturesHoles.Add

I never played with this but i think i can help you with the parameters. No warranties...

From the help files, i would say that the parameters mean:FunctionAdd ( _ nNumScopePartsAsUInteger, _ Number of affected parts by the holes we are going to create ByRefpScopePartsAsArray, _ Array of affected parts. I would bet that they must be Occurrence Objects nNumProfilesAsUInteger, _ Number of profiles containing the Hole2D object (one Hole2d object per profile) ByRefpProfilesAsArray, _ Array of Profile objects ByRefpExtentSideAsFeaturePropertyConstants, _ this is normally: igLeft, igRight pHoledataAsObject, _ Holedata object that defines the hole characteristics: Diameter, thread, counterbore, etc.. ExtentTypeAsFeaturePropertyConstants, _ this could be: igFinite, igToNext, igThroughAll, igFromTo, etc... ByRefpHoleDepthAsDouble, _ Depth in meters. pFromSurfOrPlaneAsObject, _ I would say this is optional. Only applicable if ExtentType is igFromTo. If not used, put Nothing as parameter pToSurfOrPlaneAsObject, _ I would say this is optional. Only applicable if ExtentType is igFromTo. If not used, put Nothing as parameter pKeyPointAsObject, _Don't know and can't see what it can be used for. I would try sending NothingByRefpKeyPointFlagsAsKeyPointExtentConstants _ Don't know and can't see what it can be used for. I would try sending any of the valid constants.) AsAssemblyFeaturesHole Well, that's all. I can't do anything else here.regards,Julian

 

Posted by: Julian Guillo
Post date: 5/27/2009 12:44:12 AM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

Hi, Julian, I tried, but there is nothing in SE. Can you help me or give me a sample in C++? Thank you very much!

 

Posted by: assassin 007
Post date: 5/30/2009 2:49:49 AM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

Hi, Julian, I create a command by Addin Wizard, the command include 6 steps.

First, you need to select a part in asm document, and 2nd, select another document, 3rd, select a surface on the first part, fourth, select a edge, fifth, select a vertex, and the program will create a refplane, a sketch on the refplane, and a hole with the sketch. You need to click right button of mouse to enter next step, and click the "OK" button to create the hole.

 

Posted by: assassin 007
Post date: 5/30/2009 4:18:03 AM

RE: Create RefPlane in Assembly

Valued Contributor
Valued Contributor

Hi, Julian, I'm sorry that the source codes is too large, I can't upload it. I can create the refplane and the sketch, but there is no hole. Please give me a sample in c++, if you are free, thanks!

 

Posted by: assassin 007
Post date: 5/30/2009 6:05:46 AM