Help on API AddByiMateAndEntity

Help on API AddByiMateAndEntity

cavallerin
Enthusiast Enthusiast
94 Views
3 Replies
Message 1 of 4

Help on API AddByiMateAndEntity

cavallerin
Enthusiast
Enthusiast

Hi,

 

I'm not able to call the following method:

Dim oImate As Object

Dim oMateName As iMateDefinition

Dim oFace As face

....

Set oImate = oCompDef.iMateResults.AddByiMateAndEntity(oMateName.Name, oFace)

 

 

as it returns not a valid type.

Can someone provide me an example?

thx

 

 

 

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

WCrihfield
Mentor
Mentor

Hi @cavallerin.  I honestly never use that specific method, but when I look at the online help documentation for that method (Link below), it says that the first input object is the iMateDefinition object itself, not just its name.  In the line of code where you are using that method, you are specifying the name of the definition, instead of just the definition object.  Try removing the ".Name" portion.  I can't tell much else from what little information you provided, but that might fix it.

https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=iMateResults_AddByiMateAndEntity

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

marcin_otręba
Advisor
Advisor
Accepted solution

Hi,

 

As @WCrihfield  wrote AddByiMateAndEntity method uses imatedefinition object instead of its name :

 

marcin_otrba_0-1758693070276.png

 

 

also if imatedefinition is inside componetoccurrence then you must make imatedefinition proxy object first to use it in assembly :

Dim imdp as object
occ.CreateGeometryProxy(oImate , imdp) ' proxy form occurrence containing imatedefinition
Dim oiMateResult As iMateResult = ass.ComponentDefinition.iMateResults.AddByiMateAndEntity(imdp , oface)

 

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 4 of 4

cavallerin
Enthusiast
Enthusiast

thanks both, it worked or at least I have been able to perform a constrain between imates.

Regards