CheckInterference with VBA
CheckInterference with VBA
(OP)
Hi,
I have read the thread 562-135208, but I've still the same probleme than Baat. I'm trying :
Dim set1(1) As Reference
Dim set2(1) As Reference
Set set1(1) = objdoc.CreateReference(objdoc.Occurrences(2), objdoc.Occurrences(2).OccurrenceDocument.Models(1).Body)
Set set2(1) = objdoc.CreateReference(objdoc.Occurrences(3), objdoc.Occurrences(3).OccurrenceDocument.Models(1).Body)
Call objdoc.CheckInterference(1, set1, 2, 1, 1, set2)
And SE replies (in french):
Incompatibilité de type : Tableau ou type défini par l'utilisateur attendu
In English : wrong type, array of objects or user defined type required
And the cursor is on the last set(1)
Can anyone explain me where is my mistake ?
Thank you,
Arno
I have read the thread 562-135208, but I've still the same probleme than Baat. I'm trying :
Dim set1(1) As Reference
Dim set2(1) As Reference
Set set1(1) = objdoc.CreateReference(objdoc.Occurrences(2), objdoc.Occurrences(2).OccurrenceDocument.Models(1).Body)
Set set2(1) = objdoc.CreateReference(objdoc.Occurrences(3), objdoc.Occurrences(3).OccurrenceDocument.Models(1).Body)
Call objdoc.CheckInterference(1, set1, 2, 1, 1, set2)
And SE replies (in french):
Incompatibilité de type : Tableau ou type défini par l'utilisateur attendu
In English : wrong type, array of objects or user defined type required
And the cursor is on the last set(1)
Can anyone explain me where is my mistake ?
Thank you,
Arno





RE: CheckInterference with VBA
ths one should work:
dy
======================
Dim set1(1) As Object
Dim set2(1) As Object
Dim oInterf As Object ' optional
Set mAsm = mApp.ActiveDocument
'
Set set1(0) = mAsm.Occurrences(2)
Set set1(1) = mAsm.CreateReference(mAsm.Occurrences(2), _
mAsm.Occurrences(2).OccurrenceDocument.Models(1).Body)
Set set2(0) = mAsm.Occurrences(3)
Set set2(1) = mAsm.CreateReference2(mAsm.Occurrences(3), _
mAsm.Occurrences(3).OccurrenceDocument.Models(1).Body)
Call mAsm.CheckInterference(1, set1, seInterferenceStatusConfirmedInterference, _
1, 1, set2, True, , , , , , , oInterf) ' all after set2 is optional!
MsgBox Err.Description
Err.Clear
RE: CheckInterference with VBA
Good evening,
Arno
RE: CheckInterference with VBA
I've tried your syntax method.
The good news is that there no error message.
But I'm not sure that something is done, because there no new occurence, no message and no evolution, even if there are some interferences in my assmbly.
Moreover, I would know if it's possible to recieved the result of CheckInterference in a boolean variable ? (if there are some interference : True, if not : False)
Thank you very much,
Arno
RE: CheckInterference with VBA
the methoed will check whether there is any interference
between the element(s) in Set1 and Set2 no more no less.
You may, hoever, choose a different option what to check
and how. Also possible to include more elements in
either sets.
After the method is executed and the object oInterf is
empty then there are no interferences between set1 and set2
dy
RE: CheckInterference with VBA
Arno