I am trying to read selection items for tasks in timeliner and trying to hide them using API.
this is the code for the same.
foreach (Tl.TimelinerTask oTask in tl_doc.Tasks)
DateTime date2 = oTask.ActualStartDate.Value.Date;
int result = DateTime.Compare(date1, date2);
if (result > 0 || result == 0)
Tl.TimelinerSelection oTlSel = oTask.Selection;
if (oTlSel != null)
Nw.ModelItemCollection oExplicitSel = oTlSel.ExplicitSelection;
But when i debug the program it says "the name 'oExplicitSele' does not exist in the current context. Can anyone please explain how to hide selection items attached to a task.
It is C# and you are using oExplicitSel in the brackets, right? I beleive you have figured it out after posting the question
Thank you for your reply Mr. Xiaodong Liang.
When i run the code I am facing the following error (although i added the dll as a refrence in thr app). Can you please explain why this is happening.
System.IO.FileNotFoundException: Could not load file or assembly 'Autodesk.Navisworks.Timeliner.dll' or one of its dependencies. The specified module could not be found.
Please take a look at this post. Hope you could find what you missed.
In addition, please switch the .NET framework to 4.0 if it helps.
So, I believe your app is a standalone EXE of .NET control. Unfortunately TimeLiner/ClashTest has not exposed to .NET control. you can only use them in a plugin.
The possible way I can think of is: you create an automation and plugin. plugin accesses timeliner and writes the info you need into a temporary file. When your app of .Net control wants to get timeliner info, it launches the automation, the automation starts a process of Navisworks (invisible), executes the plugin. finally, the app pf .Net control reads the temporary file and gets the info.
I am not sure which question you are answering. But please note: no API for Freedom.