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

Linestyles Duplicating

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
IAN~JAMES
2280 Views, 10 Replies

Linestyles Duplicating

We have a project that consists of 3 files making up the whole building, All files are linked into each other as are the consultants structural and services models.

 

The project started life in Revit 2014 back in March 2014 and was upgraded to Revit 2015 in September. Shortly after upgrading one of the files has suffered from duplicate linstyles for 8 linestyles that seem to replicate a number of times every day. The linestyles all seem to be civils related, but we have no civils model on the project.

 

We have got the site designer addin installed and wondered if it was connected to that??? we haven't used the addin yet, and this file is the building envelope and cores and there is no site information in it. The site is in yet another file in addition to the 3 that make up the building and the 2 internal fit out files.

 

The 8 linestyles are:

  • SW Curb
  • SW Feature Line
  • SW Parking Lot
  • SW Point Wipeout
  • SW Retaining Wall
  • SW Sidewalk
  • SW Soft Terrain
  • SW Street

Even though it isn't possible to create duplicate linestyles with the same name through the UI, this seems to be possible by whatever is causing the problem. I have used a Revit Python Script to find and list all of these linstyles and they all have unique ElementID's and I can delete them using these ID's again using Python Script. The linestyles are not in use by anything in the model so deleting them causes no problem. I ran the script yesterday and today there are 12 of each linestyle in the model (96 in total) because from running it 6 days ago there were 66 versions of each of the 8 linestyles in the model (528 linestyles) when I first ran it, they had been accumulating it for some time and there were 463 of each linestyle (3704 in total) It looks like there are between 10 and 15 accumulating each day, We are putting something in place to log this at syncronization time to try and spot if it is connected to a partular user or activity, but wondered if anyone else out there was having this strange behaviour.

 

The other project files on the job have 1 version of each linestyle and seem to be stable it is this one file that seems to have this problem.

 

Any help or observations appreciated.

 

Cheers

 

Ian

 

10 REPLIES 10
Message 2 of 11
BM_MTALink
in reply to: IAN~JAMES

HI

 

I am having the same problem and I am wondering what is causing this. 

Message 3 of 11
BM_MTALink
in reply to: BM_MTALink

Hi

 

I think I found out the reason. Not from Autodesk.

So this is just a tip for people to not get 80 new linetypes that are duplicated.

So in Revit 2015 there is an add-in called site designer 

Once you touch any of the commands on there just once,  such as feature line, or sidewalk or curbs, etc... it creates those 8 linetypes. 

Once you sync and everytime you sync it creates at least 8 more duplicates, so imagine syncing 27 times you will have 27 of the same line type show up.

 

So my advice is not touch that site designer tool unless you actually have a landxml file and topo in your file.

That is what I found so far. I'll keep digging if anything else pops up.

Tags (2)
Message 4 of 11
IAN~JAMES
in reply to: BM_MTALink

Hi Yes, 

 

I've heard that it is the site designer (Originally called SiteWorks hence the "SW" prefix)

 

We are however finding that the linestyles are duplicating without anyone going anywhere near the addin. We are looking at removing the addin from the install, but that seems to be taking some tome to organise.

 

We have monitored when the linestyles are created over a period of time and found that it happens with various users and not on every sync' operation and we haven't managed to find a pattern at all. The files that we are talking about have no site information in them either which is more confusing and also proof that it isn't related to use of the tool.

 

Regards

Message 5 of 11
demetriosx
in reply to: IAN~JAMES

Were you able to find a solution for this? I am experiencing the exact same issue on one of my projects.

Message 6 of 11
BM_MTALink
in reply to: demetriosx

I just uninstalled the site designer add-in and it stopped multiplicating the line styles every time you sync.

And if you can't do that I Just had everyone stop playing with it by pressing one of the commands. I found that once you press a command it activates the line styles.


@demetriosx wrote:

Were you able to find a solution for this? I am experiencing the exact same issue on one of my projects.


 

Message 7 of 11
IAN~JAMES
in reply to: BM_MTALink

I ended up writing a python script to find all of the linestyle element Id's and delete them from the file.

 

If you have the python shell installed you can copy and paste this source code into the shell and run it with the file open obviously.

 

 

# The following code is shared without any guarantee or warranty to the recipient.
# if distributed, this code should be copied in it's entirety together with this
# discalaimer.
#
#
#
# # Looks for Rogue "SW" Linestyles in the Revit Project # and removes them if they are one of the following leaving
# the original instance of each linestyle:
# # SW Curb # SW Feature Line # SW Parking Lot # SW Point Wipeout # SW Retaining Wall # SW Sidewalk # SW Soft Terrain # SW Street #------------------------------------------------------ clr.AddReference("System.Windows.Forms") from System.Windows.Forms import * #------------------------------------------------------ x = FilteredElementCollector(doc).OfClass(CurveElement) # Just get the first line elements and from that # we can access all of the linestyles in the model. i = x.FirstElement() ids = i.GetLineStyleIds() data = {"SW Curb":[],"SW Feature Line":[],"SW Parking Lot":[],"SW Point Wipeout":[],"SW Retaining Wall":[],"SW Sidewalk":[],"SW Soft Terrain":[],"SW Street":[]} count = 0 #-------------------------------------------------------------------------------# # # #-------------------------------------------------------------------------------# def deleteLineStyles(theList,theName): msg = "Deleting All Linestyles:" + theName tranny = Transaction(doc) #print 'Starting Transaction:',msg tranny.Start(msg) for i in range(1,len(theList)): doc.Delete(theList[i]) tranny.Commit() #-------------------------------------------------------------------------------# # # #-------------------------------------------------------------------------------# def ReportFindings(): msg = '' msg = msg + 'Following Rogue Linstyles found in this project:\n' for ls in data.keys(): msg = msg + '\n' + str(len(data[ls])) + '\t:\t' + ls msg = msg + '\n\nDo you want to Delete them' if System.Windows.Forms.DialogResult.Yes == MessageBox.Show(msg,'Rogue Linestyles Found',MessageBoxButtons.YesNo,MessageBoxIcon.Warning): for d in data.keys(): #For Each List in the dictionary, sort the list to get the earliest ElementID to the start of the list #Then loop through and delet all of the other rogue linestyle elements keeping the original. print "-" * 75 print "Deleting: ",d print "Keeping Earliest Element:",data[d][0] deleteLineStyles(data[d],d) #-------------------------------------------------------------------------------# # # #-------------------------------------------------------------------------------# def main(): global count for i in ids: lsName = doc.GetElement(i).Name if lsName in data.keys(): #If we Match a word in the list, figure out which one it is. #Add the ElementID to the list associated with that name. data[lsName].append(i) #(i.IntegerValue) #print count count += 1 ReportFindings() #-------------------------------------------------------------------------------# # # #-------------------------------------------------------------------------------# if __name__ == "__main__": main()
Message 8 of 11
Chris.Aquino
in reply to: IAN~JAMES

Thank you for creating a script which automates the deletion process.

 

This is a known issue which is logged with our Development Group. We are currently investigating a possible resolution, but the permanent fix requires the code for the Site Designer add-in to be changed, and as such we do not have an immediate fix.

 

Once we do have a permanent fix, we will post it as an update to the article below:

 

Revit: Thousands of new Linestyles show up in project

 



Chris Aquino
Adoption Marketing Manager | BIM Collaborate Pro
@Aquinotecture

Message 9 of 11
dirk
in reply to: Chris.Aquino

Hi Keldar67

 

please could you explain the process of implementing this script? is it a macros, dynamo etc. I have this problem at the moment but i dont know how to use your script. Thanks for the Effort!!

Message 10 of 11
IAN~JAMES
in reply to: dirk

Hi Chris,

 

We have been using the Revit Python Shell for a while to automate a few bits and pieces, so as part of a learning exercise I took this on and eventually got it working, but I am not an expert in Python, Revit or otherwise.

 

You will need the Revit Python Shell installed, then kick off the shell and load the file and then run it...

 

Setting up the shell needs a little bit of know how, but we have a guy here who sorts that stuff out, unfortunately he is off on quite a long break at the moment. We have certain things configured so you have immediate access to variables like

 

doc - The active document

selection - the current selection

uiapp - UIApplication

etc...

 

I realise that if you don't currently have this set up then my script is of little or no help at all... but if you fancy setting this up or know someone who can, then it can solve the problem for you...

 

python shell icon.PNG

 

python shell.PNG

 

sorry I can't be more help.

 

I am looking at re-writing this in C# as a proper Revit plugin, but we have found that while it removes the linestyles from the drop down in the main user interface, if you go into the Linestyles in Additional Settings under the Manage tab, the subcategories are still in there... I haven't found a way to get rid of these yet.

 

Regards

 

Ian

Message 11 of 11
ehsanirannejad
in reply to: IAN~JAMES

Meanwhile if anyone wants to disable the Site Designer (It won't be loaded into Revit anymore), try this:

 

The site desiger assmebly is:

AutodeskSiteDesignerForRevit2015, Version=2015.1.0.0

 

Disable it by renaming the .addin file under the folder below:

C:\ProgramData\Autodesk\ApplicationPlugins\AutodeskSiteDesignerForRevit2015.bundle\Contents\

 

Rename file:

AutodeskSiteDesignerForRevit2015.addin

To:

AutodeskSiteDesignerForRevit2015.addin.bak

(this is to make the file invisible to Revit without deleting it)

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

Post to forums  

Rail Community


Autodesk Design & Make Report