Workstation Settings

Macro: Create Isolated 3DView based on Workset

Finally got around to adding the code to modify a great routine published by Harry Mattison back in 2015.  I’ve been using the routine to generate the isolated 3D views, but from the first time I ran it, I wanted a way to do workset isolation rather than element level temporary isolation.  Using the Harry’s original code, I added a dictionary and the SetWorksetVisibility code segments.  The code published below will set the workset visiblity for the view in addition to the element.

Harry’s original post

My modified code shown below (Application Macro):

public void CreateIsolatedWorksetView()
{
Document doc = this.ActiveUIDocument.Document;
int max = 100;
if (!doc.IsWorkshared)
return;

// get the 3d view type which is needed when creating 3d views
ViewFamilyType vft = new FilteredElementCollector(doc)
.OfClass(typeof(ViewFamilyType))
.Cast<ViewFamilyType>()
.FirstOrDefault(q => q.ViewFamily == ViewFamily.ThreeDimensional);

using (Transaction t = new Transaction(doc, “workset view isolation”))
{
t.Start();
// create a dictionary to hold the worksetid and workset name
Dictionary<string, Autodesk.Revit.DB.WorksetId> dict =
new Dictionary<string, Autodesk.Revit.DB.WorksetId>();
// loop through all worksets (but only User worksets)
foreach (Workset wset in new FilteredWorksetCollector(doc).WherePasses(new WorksetKindFilter(WorksetKind.UserWorkset)))
{
dict.Add(wset.Name, wset.Id);
}
They simply guide you with the appropriate medicine which can make you completely free form erectile canadian viagra samples dysfunction. Side Effects of Cenforce XXX Cenforce XXX is an effective medication that is used for good supply of blood levitra pill to the penis. It ensures energy producing reactions in your body through the use of a natural moisturizer (such as Shea butter, cocoa butter or jojoba oil) can help to protect the penile skin looking supple and smooth, but it also prevents cellular damage from free radicals. cialis on line sales here For someone who is having erectile dysfunction, the medicinal benefits outweigh the risk factors. levitra 10mg foreach (Workset wset in new FilteredWorksetCollector(doc).WherePasses(new WorksetKindFilter(WorksetKind.UserWorkset)))
{
// create a 3d view
View3D view = View3D.CreateIsometric(doc, vft.Id);

// set the name of the view to match the name of the workset
view.Name = “WORKSET – ” + wset.Name;

// isolate elements in the view, using a filter to find elements only in this workset
view.IsolateElementsTemporary(new FilteredElementCollector(doc).WherePasses(new ElementWorksetFilter(wset.Id)).Select(q => q.Id).ToList());
view.SetWorksetVisibility(wset.Id, Autodesk.Revit.DB.WorksetVisibility.Visible);
for (int i = 0; i < max; i++)
{
foreach (var pair in dict)
{
// verify not current workset
if (pair.Key != wset.Name)
{
view.SetWorksetVisibility(pair.Value, Autodesk.Revit.DB.WorksetVisibility.Hidden);
}
}
}
}
t.Commit();
}
}

Workstation Settings
Create 3D Isolated Views by Workstation

 

Upgrading Application Macros for New Versions of Revit

This time of year requires a large number of upgrades. I recently wrote about upgrading the Revit library and templates, but there are many file types in the The antioxidants in ground nuts protect http://cute-n-tiny.com/tag/puppy/page/3/ buy cheap cialis heart and supply essential minerals like copper, zinc, iron, magnesium, potassium etc. Second, medicated Bath method Composition includes Chrysanthemum (ju hua) 20 grams, folium artemisiae argyi (ai ye) 20 grams, Fructus Cnidii (she chuang zi) 20 grams, dandelion (pugongying) 20 grams, viagra pills from canada Houttuynia cordata(Yu xing cao) 20 grams, mint(Bo he) 5 grams Boil them and add water to get a sitz bath twice a day for 15min each time. Of all medicine accessible in the stores today, Kamagra has really made a unique mark as an effective anti-depressant and serves people http://cute-n-tiny.com/cute-animals/sleepy-puppy-phone/ buy generic viagra an escape from the problem. Yet on the flip side, those who suffer from a lost cute-n-tiny.com generico viagra on line interest in performing lovemaking. design ecosphere. Today we focus on upgrading application level macros inside Revit. Visit Wakefield Beasley’s blog here to read my latest blog post on upgrading Revit application macros.