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

Assigning sets to timeliner activities... quickly?

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
stgauss
3194 Views, 9 Replies

Assigning sets to timeliner activities... quickly?

Hello,

 

I'm working on one of those timeliner simulations that tends to be a bitch. Have about 1700 elements that I need to sequence, with a reasonable resolution. "Reasonable resolution" meaning most elements have to be assigned to a certain timeliner day, so they'll show up in the correct order and allow for conflict detection. In other words no entire floors showing up at once.

 

I've got it pretty well solved. What I did was group the RVT model into activities via a project parameter. I set this one to "foundations", "columns", "beams", etc accordingly. I also gave it another project parameter for sequence. That one simply holds 1,2,3,4,etc depending on the order of construction.

 

Then I scheduled by sequences in MS Project. As you'd imagine: foundations sequence 1, foundations sequence 2, foundations sequence 3, columns seq 1, columns seq 2, etc.

 

Pretty easy up to that point. The idea is simple: you attach elements from foundations sequence 1 to timeline foundations sequence 1.And so on. And you link your Project file. All done via search sets.

 

Once you're done attaching, if you change the sequences in your RVT model, the timeliner changes accordingly thanks to the sequence parameter. And if you change your durations in MS Project, timeliner updates thanks to the data link.

 

(Really important hint: use Unique ID and NOT regular "ID" in Project to identify your tasks. If you use regular ID, you'll be sorry if you have to change the activity list later on)

 

For the sets, I exported a set sample from NW to an XML file, and then wrote a VBA script in Excel to generate all the sets I needed, about 40.000 lines of XML code. Then I simply imported that file into NW.

 

Neat part is, with that arrangement I can play around with durations and activity order until I arrive at a simulation where everything's in sync and there's minimal activity conflict.

 

Ok, now the question:

 

I have about 400 search sets I need to attach to timeliner activities. For the most part that means click on search set, drag on top of the timeliner activity, release. 

 

It's doable by hand in about 15 minutes, but I was wondering if anyone has a more efficient solution. Something that might automate that assignment or at least make it go faster. (I'm not looking for an API solution on this one, already had enough nightmare scenarios with the RVT API...)

 

Any ideas?

 

 

 

9 REPLIES 9
Message 2 of 10
danielkazado
in reply to: stgauss

Hi, 

 

 I understand from your post that you already have the activities imported and  ready in Navisworks and prepared the Search Sets that shall be attached to these activities. You are looking for a one click 🙂 to do this. The good news is yes it is possible.

 

In Timeliner, under Tasks tab click "Auto Attach Using Rules" (button just near Attach).  From the list if existing select "Map Timeliner Tasks from the Column Name to Selection Sets with the same name, Ignoring case". If this option is not listed in the list than just click New and crerate the same with Attach Items to Tasks. What this Rule does is you select a column from your activity and attaches the matching name activity to that one. If you already done with Search Sets and you do not have any column in schedule mathing with this name. Create a seperate column in your MS project for this purpose and use this one. 

 

So to summarize if you have a column with the same wording of Search Sets, Attach will be one click. 

 

Hope helps...

Daniel Kazado

Please use Accept as Solution if your question is answered.
You may Give Kudos if the answer is helpful.
Message 3 of 10
stgauss
in reply to: danielkazado

Yes, that seems like it will work just fine... only one detail: my sets are grouped into different folders in the set list, and I need to use your alternate solution (create a column in MS Project for the mapping). 

 

So, I'm using Text10 field in Project and mapping that one to User10 in NW. And I created a rule for attaching sets using User10 as a reference.

 

Let's say I have a top level set, MySet. So I right click in the set list, copy name, and paste into the User10 field in Project, then sync and apply the rule, perfect. The set attaches just fine.

 

But, I have another set in a folder. Folder "Myfolder", set "Folderset". When I manually drag this one onto the task list, I get an attachment that says "Sets -> Myfolder -> Folderset".

 

If I type "Folderset" (or copy the name) into User 10, it doesn't attach. If I type "Sets -> Myfolder -> Folderset" into User 10, doesn't attach either. 

 

I guess I'm probably messing up on the naming convention here. How do I specify the name for a set in a folder, for use with your solution?

 

Message 4 of 10
danielkazado
in reply to: stgauss

Hi, 

 

 The auto attach rule is looking for the same name of Set regardless of in which folder it is. So if you have same name of Sets in different folders than first found attaches to the activity. The typing you see in the Attach column of the schedule is only for explanation and can not be used for matching. So if you have same set name in different folders, first listed in the Sets will be attached. 

 

If you have two folders named "MySet" and "MyFolder" , and you have a Set named "FolderSet" in both folders than you have to rename these sets like "MySet_FolderSet" and "MyFolder_FolderSet". If you have the same wording in your User10 field it will auto attach the sets. As you are using xml, it will be easy to rename your sets. 

 

To summarize, folders in the Sets is only for better arrangment and will not effect your rule running. What the rule is looking for is to find the same wording from User10 in your Set names, and first found attaches to the activity. 

 

Hope Helps...

Daniel Kazado

Please use Accept as Solution if your question is answered.
You may Give Kudos if the answer is helpful.
Message 5 of 10
stgauss
in reply to: danielkazado

Actually, it did! Typed in the search set name, auto attach, and the sets are now attached. And like you said, doesn't matter whether they're inside folders or not.

 

Thanks...

 

Message 6 of 10
ertozs41
in reply to: stgauss

Hello stgauss,

 

I would be very much interested to see how you wrote the VBA script in Excel to generate the search sets as I'm doing a very similar thing myself (sequencing ~1000 elements). Any more hints or pointers would be really appreciated.

 

Thanks in advance!

Pete

Message 7 of 10
stgauss
in reply to: ertozs41

I'll post the code here soon as I can. It's 2 or 3 nested for loops and a couple of string array variables. What I did was create a set and a folder in Navisworks, and export to XML. Then I opened the XML in a text editor and copied the lines that define the search set (you'll see they're enclosed by <selectionset> tags if you open one of those XML files). 

 

The lines went into a VBA text array, code_line(1), code_line(2), etc. Nothing special, just copy and paste them.

 

Then I created another array with an activity list. activitylist(1)="FOUNDATIONS", activity(2)="RETAINING", etc.

 

And I just loop over and over again:

 

for activity = 1 to 5

for sequence = 1 to 50

for codeline = 1 to 40


select case code_line
...
case else
cells(lastrow,1) = code_line(codeline)
end select next next next

The select statement allows me to modify the XML lines that contain variables for the sequence indicator and the activity indicator. So for example if line 4 defined my activity search variable, there would be a "case 4" statement, which would lead to a modified version of the line: just a cells(lastrow,1) = "etc etc" + activitylist(activity) + "etc etc" kind of thing.

 

If I want to create folders for each activity, I just add a <viewfolder> tag after the for loop starts and a </viewfolder> tag before the next statement.

 

lastrow is a function I got off one of those code websites (I think it was stackoverflow), that finds the next available row.

 

So in the end I get a 50 search sets for activity FOUNDATIONS, then 50 sets for activity RETAINING, then 50 sets for the next one, and so on. And then just copy the output and paste back into your XML file, overwriting your original search set code.

 

One last detail: excel is a real pain when it comes to quotation marks. And XML is full of quotation marks. So before you copy your XML code, run a find/replace and substitute all quotation marks with "[QUOT]". And when you copy your final code, invert your replacement so [QUOT] turns into ". That way you won't have to worry about double marks and misplaced marks in Excel.

 

Last XML I generated for a large building (about 6000 m2 with 3 floors and 5 or 6 activity sequences) was about 40.000 lines... import went without a hitch. Just make sure you keep the XML structure right and don't forget the header and closing tags, or you import won't work.

 

 

 

Message 8 of 10
ertozs41
in reply to: stgauss

Thank you for the reply. Your method seems like a very robust and concise way to generate search sets. I would love to see the actual code if you have time to post and are willing.

 

At the moment I am using a much less efficient method. I created a search set in Navisworks with parameters called "change me", exported to XML, and basically copied and pasted the same amount of times as the number of elements. I then used a VBA script I found on stackoverflow to replace "change me" with the correct names of each element. As a result every search set have identical properties and had to be carefully defined.

(Link to VBA script: http://stackoverflow.com/questions/15456798/how-can-i-find-replace-multiple-strings-in-an-xml-file)  

Message 9 of 10
stgauss
in reply to: ertozs41

There's the code file. Just open the Excel code window, and import (or copy/paste). Then adjust according to your needs. The code is pretty well commented.

 

Originally the file was .BAS, but I had to change it to .TXT to get the forum to accept it. 

 

.BAS are a regular text files so, not harm done with the extension change. Also, you can also open it in your favorite editor and look it over if you're nervous about importing macro code into your computer.

 

 

Remember you need to enable macros in Excel in order to run the code.

 

Message 10 of 10
stgauss
in reply to: stgauss

Whoops, there's a small but very annoying bug in the code:

 

In the outlines loop:

 

 Case 34
      code_line(34) = "                  <data type=[QUOT]float[QUOT]>" +  Str(searchset) + "</data>"
      writeline (codeline)

The name of the variable is incorrect. Replace code_line(34) with "codeline":

 

 Case 34
      codeline = "                  <data type=[QUOT]float[QUOT]>" + Str(searchset) + "</data>"
      writeline (codeline)

If you don't replace that variable name, you're going to get every search set with the "No. Secuencia" parameter set to 1.

 

Corrected code attached...

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

Post to forums  

Rail Community


Autodesk Design & Make Report