Hi, friends!!
I want create railing by CurveLoop. I using this create method from revit API:
But in OUT I have a null. Why? there are no warnings. What have I done wrong?
You need to ensure the curve set have coincident start/end points and the start point of curve A meets the end point of curve B. If the start points of two curves are coincident, the curve loop with fail, so you may need to write some additional python code to evaluate the junction conditions and reverse one of the curves if that is the case.
I tried just apending a line type in a curveloop data(such as a line type data from [0,0,0] to [1000,0,0],was appended to the curveloop by the method append),also comes the error:the sketch is null.
In my thoughts,I think , if just one line type data append to the curveloop comes errors, it has some other error in the way I use the api?
Could you give some example codes? or,some example points data?
I use the revit api by C#.
I meet the problem you have got.
Also,I found that,if I open a file by hand,and use the document like:
Autodesk.Revit.DB.Document revit = commandData.Application.ActiveUIDocument.Document;
It is ok when I use the revit api.Just if the points is right.
But,if I do like this:
Autodesk.Revit.DB.Document revitdoc = commandData.Application.Application.NewProjectTemplateDocument(@âC:\ProgramData\Autodesk\RVT 2017\Templates\China\DefaultCHSCHS.rteâ);
I create a new file by codes, the error will come ,âthe sketch is nullâ.
FinallyďźI get the information:
If I create a document by api,the codes is not well.
But if I create a document by UI click,the codes will work.
Thanks very much!Have a nice day.
Have a look at the first post, you need to import all the modules⌠Everything from âimport clrâ downwards⌠Transactions comes from the RevitServices module as does DocumentManagerâŚ
There is good advice on learning Python with Dynamo hereâŚ