vba in autocad Need Help

Discussion in 'AutoCAD' started by freedom_sure sir, Sep 8, 2004.

  1. I have many 3D-Solids in the drawing space and want to check if they
    interfere with the other specified 3D_solid.
    The resulting 3D-Solid is stored in "checkobj".


    Dim obj As AcadObject
    Dim checkobjAs Acad3DSolid
    Dim Schnitt As Acad3DSolid
    for each obj in ThisDrawing.ModelSpace
    Set Schnitt = Werkstück.CheckInterference(obj, True)
    next



    when i use "for each loop ",erro comes to me:

    incorrect datatype :-13

    how can do ?

    freedom_sure sir
     
    freedom_sure sir, Sep 8, 2004
    #1
  2. You have to check to be sure your object is a Solid first and then you have
    to check that it isn't the same solid you are checking the interference of
    this will work

    Dim Obj As AcadObject
    Dim Obj2 As AcadObject
    Dim checkobj As Acad3DSolid
    Dim Schnitt As Acad3DSolid
    Dim ObType As String
    For Each Obj In ThisDrawing.ModelSpace
    If TypeName(Obj) = "IAcad3DSolid" Then
    For Each Obj2 In ThisDrawing.ModelSpace
    If TypeName(Obj2) = "IAcad3DSolid" Then
    If Not Obj Is Obj2 Then
    Set Schnitt = Obj.CheckInterference(Obj2, True)
    End If
    End If
    Next
    End If
    Next
     
    Corey Scheich, Sep 8, 2004
    #2
  3. as that was written it would create 3 interference objects because you will
    have to check if you checked the interference already. and be sure you
    didn't check interference of the new solids.
    FYI

    I would suggest changing the color of the interference objects too.

    Corey Scheich
     
    Corey Scheich, Sep 8, 2004
    #3
  4. Has this worked for you?


     
    Corey Scheich, Sep 10, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.