Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pick Support tool

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Moustafa_K
487 Views, 4 Replies

Pick Support tool

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
Tags (2)
4 REPLIES 4
Message 2 of 5

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
Message 3 of 5

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
Message 4 of 5

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
Message 5 of 5

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community