Results 1 to 10 of 10

Thread: curve intersect result

  1. #1
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default curve intersect result

    I'm trying to compare a set of walls to see what level of intersection they have (if any). To test, I just have file with 4 walls in a square. The following code is run after adding each wall to a set called "WallSet" and copying it to "wset2". So essentially I'm comparing each wall to every wall in the project right now (including itself) so I would expect to get 4 "equal" and the rest "disjoint" or maybe "overlap". However, I am getting all 16 comparisons coming back as "equal". What am I missing about how this method works?

    Code:
     
    For Each w As Wall In WallSet
         Dim cv As LocationCurve = w.Location
         For Each w2 As Wall In wset2
              Dim cv2 As LocationCurve = w2.Location
              Dim r As Autodesk.Revit.Enums.SetComparisonResult = cv.Curve.Intersect(cv.Curve)
              MsgBox(w.Name.ToString & " & " & w2.Name.ToString & ": " & r.ToString)
         Next
    Next

  2. #2
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: curve intersect result

    ugh, how about I intersect two DIFFERENT walls, instead of the same one, of course it's equal... Always the small dumb stuff...

  3. #3
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: curve intersect result

    ok, I have another question that hopefully isn't quite as dumb...

    How would you go about checking two walls between levels? Basically I want to check if two walls are exactly on top of each other. I can check when they are on the same level by the above (getting the curve and doing an intersect).

    However, if they are on different levels the the curves do not intersect. So what I would like to do is just take the curves, clone them, and set the z coordinate on the clones to 0, then run an intersect. I can't find a way to change the curves once I have them, though.

    Can anyone help?

  4. #4
    Active Member
    Join Date
    2005-09
    Posts
    69
    Login to Give a bone
    0

    Default Re: curve intersect result

    I think what you need to do is
    clone the points for the location curves (XYZ)
    change the Z values of the points
    create new curves from the points
    Sorry - not got time to write the actual code

  5. #5
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: curve intersect result

    Quote Originally Posted by david.bartliff View Post
    I think what you need to do is
    clone the points for the location curves (XYZ)
    change the Z values of the points
    create new curves from the points
    Sorry - not got time to write the actual code
    no problem, direction is good. I was able to get the points and 0 out the z cooridinate, but for the life of me I can't figure out how to create a curve from the new points. I can also clone the existing curve and use the 'set_endparameter' method, but that asks for index which is the which end point (fine) and parameter as double... I can't figure out what the end parameter is, and if I try putting 0 in it just gives me an error. When I try to dim a new curve it just says that curve is set to MustInherit so it can't use New. So how do I construct a new curve from the points?

    thanks for any help...

  6. #6
    Active Member
    Join Date
    2005-09
    Posts
    69
    Login to Give a bone
    0

    Default Re: curve intersect result

    Look at NewLinebound and NewArc under Autodesk.Revit.Creation.Application
    i.e. something like rvtApp.Create.NewLineBound( pointA, pointB);

    I cant remember exactly what the parameters are for - is it something like 0.0 is the start and 1.0 is the end, so if you change the end to 3.0 the line will be extended in the same direction so its 3 times longer?

  7. #7
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: curve intersect result

    you rock, the newlineboud worked great, thanks!

  8. #8
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: curve intersect result

    ok, full of questions on this one. I have it working pretty much, so thanks for your help. However, I can't figure out how to tell the difference between a curved wall and a straight wall. All I see is the ability to get the two endpoints, so using the NewLineBound just creates a straight line between the ends.

    This actually gets me most of the way to what I want, but it will say the walls are stacked above each other if the endpoints are the same, even if the radius is different...

    Sorry, I've been searching through the API help menu and documentation, but there's a lot about curves that I just am not getting and am not finding much info on...

  9. #9
    Active Member
    Join Date
    2005-09
    Posts
    69
    Login to Give a bone
    0

    Default Re: curve intersect result

    Well here's some more pointers. I'm doing this very quickly without checking syntax, (and I dont use VB.NET)
    The LocationCurve.Curve object will actually be a sub-class of Curve, e.g. Arc or Line. You can use the "is" operator to find out which - something like
    if (cv.Curve is Autodesk.Revit.Geometry.Arc) ...

    Once you know exactly what type of object it is, you can cast it if you need to, i.e. something like
    Dimension MyArc as Autodesk.Revit.Geometry.Arc
    MyArc = cv.Curve as Autodesk.Revit.Geometry.Arc (not at all sure about this statement)

    Another thing to look at is Evaluate. If you have bound lines or arcs, (which you should have), then Evaluate(0.5) will either be halfway round an arc, or the middle of a line. I think you should be able to use 3 points to create a new arc, (equivalent to NewLineBound) if thats what you need to do.

  10. #10
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: curve intersect result

    ok, good to know. I will check those out, thank you so much for your help!

Similar Threads

  1. 2013: Footings that Intersect
    By clintonc in forum Revit Structure - General
    Replies: 9
    Last Post: 2013-03-28, 05:23 PM
  2. Toposurface wall intersect
    By dznr27 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2011-06-09, 09:55 PM
  3. Intersect and helix command
    By vladdavostock in forum AutoCAD 3D (2007 and above)
    Replies: 0
    Last Post: 2010-10-24, 04:05 AM
  4. Replies: 3
    Last Post: 2007-06-05, 06:29 AM
  5. Intersect Geometry
    By nsinha73 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2006-11-28, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •