Pick Support tool

Pick Support tool

Moustafa_K
Collaborator Collaborator
733 Views
4 Replies
Message 1 of 5

Pick Support tool

Moustafa_K
Collaborator
Collaborator

Hi all

i just  more or lless got my feet wet in Revit API, so please forgive me if my question is a bit Silly.

 

i have Created an inclined beam and floor. i need to pick the location curve of the beam to be as a support for the floor.

 

i have tried it via API all is created fine except the support issue, however when i picksupport Manually(through UI) it works perfectly fine.

 

here is the code i have writen

//Line List 
IList<Line> ll = new List<Line>();
Transaction t = new Transaction(doc,"Cr. Beam"); FamilyInstance inst = null; //Create Beam if (doc.LoadFamilySymbol(path, symbolname, out symbolic)) { inst = doc.Create.NewFamilyInstance(curve, symbolic, null, StructuralType.Beam); //Get Location Curve and add to list of Lines LocationCurve beamCurve = inst.Location as LocationCurve; Line line = null; line = (Line)beamCurve.Curve; ll.Add(line); }
t.Commit()
Transaction ut = new Transaction(doc,"Cr. Slopedfloor"); ut.Start(); Floor fl = doc.Create.NewFloor(carr, false); doc.Regenerate(); foreach (Line l in ll) { fl.SlabShapeEditor.PickSupport(l); } ut.Commit();

 this code is collected from diffrent parts of the original.

 

the error says " The input line is invalid for Suport".... i wounder should it be a special type of line to cast from Location Curve?

 

i hope i was clear, any Suggestions???

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
Accepted solutions (1)
734 Views
4 Replies
Replies (4)
Message 2 of 5

augusto.goncalves
Alumni
Alumni

I'm wondering what kind of Lines you're getting from the Family, the PickSupport should reject lines that are not valid to create the support...

 

Can you check that? If the lines are indeed those you expect...

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 3 of 5

Moustafa_K
Collaborator
Collaborator
i got the type to be "using Autodesk.Revit.DB.Line" which is the same type needed for PickSupport Method.
public void PickSupport(
Line gLine
)
so it is matching what the method expects, isn't it?
Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
Message 4 of 5

augusto.goncalves
Alumni
Alumni

From the exception you mentioned, it seems that the Lines are not like they supouse to be, geometric speaking.

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 5 of 5

Moustafa_K
Collaborator
Collaborator
Accepted solution
I solved the problem using another tool which is Draw point(), i picked the end and start points of the Location curve and used the DrawPoint... although the exception is so confusing like, you said , to understand why it didn't pick the support.... but solved... Thanks Augusto
Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes