×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CheckInterference with VBA

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

RE: CheckInterference with VBA

Arno,

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

(OP)
Thank you very much donyoung, I will try tomorrow.
Good evening,
Arno

RE: CheckInterference with VBA

(OP)
Hi donyoung,

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

Arno,

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

(OP)
Thanks you very much,
Arno

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources