Can't Delete Multiple Linestyles

Can't Delete Multiple Linestyles

CharlesBerteaux
Advisor Advisor
7,425 Views
19 Replies
Message 1 of 20

Can't Delete Multiple Linestyles

CharlesBerteaux
Advisor
Advisor

What the heck is the reason for buttons that do absolutely nothing?????

 

And Why does the Site Designer tool add layers to Revit???? I can understand 1 per type of object, but this is ridiculous!!

 

Revit Line Styles.png

Charles Berteaux Iv
EDT BIM/VDC/Technology Department Manager | SSOE Group | Hillsboro
www.ssoe.com

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

Accepted solutions (2)
7,426 Views
19 Replies
Replies (19)
Message 2 of 20

chrisplyler
Mentor
Mentor

I don't know about all those repeated lines styles. That's crazy!

 

But you'll notice that the delete button is under a heading called "Modify Subcategories." You'll also notice that all the lines you have selected are Categories, not Subcategories.

0 Likes
Message 3 of 20

David_W_Koch
Mentor
Mentor

All those seemingly identical subcategories are clearly a programming problem.

 

As for the grayed out Delete button, that button will only be active if all of the selected items are unreferenced in your model.  At least one of the selected SW Parking Lot subcategories must be in use (perhaps all are).


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

Message 4 of 20

CharlesBerteaux
Advisor
Advisor

I agree David!

 

This Siteworks issue (all the multiple subcategry lines SWXXX) has been escilated to Autodesk.

 

For now I am just going to have to manually Delete them all by hand Smiley Sad

Charles Berteaux Iv
EDT BIM/VDC/Technology Department Manager | SSOE Group | Hillsboro
www.ssoe.com

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

0 Likes
Message 5 of 20

CharlesBerteaux
Advisor
Advisor
Accepted solution

We basically built a script to handle all this nonsense....

 

Code is here for anyone interested:

 

#select a detail/model line first
selection = list(__revit__.ActiveUIDocument.Selection.Elements)
if len(selection) > 0:
el = selection[0]
styles = el.GetLineStyleIds()

if len(styles):
t = Transaction(doc, 'Delete all SW Lines')
t.Start()

for s in styles:
el = doc.GetElement(s)
if el.Name[:2] == 'SW':
print ('Line Style Deleted:\nID: {0}\tNAME: {1}\n'.format(el.Id, el.Name) )
doc.Delete(s)

t.Commit()

Charles Berteaux Iv
EDT BIM/VDC/Technology Department Manager | SSOE Group | Hillsboro
www.ssoe.com

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

Message 6 of 20

Chris.Aquino
Autodesk
Autodesk

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 an immediate 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 7 of 20

Anonymous
Not applicable

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)

0 Likes
Message 8 of 20

Anonymous
Not applicable

Where can I run this code? Pythonshell? as a macro? I need to remove thousands of line styles.

0 Likes
Message 9 of 20

Anonymous
Not applicable

Yes. Run the code in RevitPythonShell

 

The most recent version of the code is here:

Wipe_deleteSiteDesignerLineStyles.py

Message 10 of 20

Anonymous
Not applicable
Thanks eirannejad,
That script worked for "Normal" Line Styles.
I still have thousands of line style with the same name(I thought it was only possible to have unique names).
But when I run the script and point it at the offending Line Style it cannot find it. It will find other Line styles but not the one I am trying to get rid of.
I think it came in through an exploded CAD file months back, not site designer.
That's what I was told anyway.
0 Likes
Message 11 of 20

Anonymous
Not applicable

Okay let's get the references right first.

There is no such thing as Normal line styles.

 

There are Line Styles and Line Patterns.

 

Site Designer creates extra Line Styles which this script removes.

 

CAD files bring Line Patterns. See if you can modify this script for your use: Wipe_deleteIMPORTLinePatterns.py

 

hope this helps.

0 Likes
Message 12 of 20

Anonymous
Not applicable
Thanks eirannejad.
I said "Normal" Line Styles as the one I want to delete is not behaving like a Line Style. I cannot delete this misbehaving Line Style using any method I've come across. It doesn't show up when I list all Line Styles using pythonshell or Dynamo, but it is present in the project as a Line Style(thousands of times).

A CAD file was imported and exploded it seems, that had a layer named the exact same the misbehaving Line Style . Very odd. Most likely the file is corrupt and cannot be saved it looks like.

Thanks for your help anyway eirannejad.
0 Likes
Message 13 of 20

Anonymous
Not applicable

Ha. Okay.

So you still have Line Styles that don't show up in API queries. I would highly suggest that you install RevitLookup and inspect the Line Style elements. Find their Element IDs and see if you can delete them by doc.Delete()

 

Also, you can send me a cleaned up version of your file and I can take a stab at it.

 

Thanks

0 Likes
Message 14 of 20

Anonymous
Not applicable
Hi eirannejad,


Regards

Neil Reilly

ARCDOX Architecture | Documentation
Enabling & Supporting BIM | Building Information Modelling | Consultancy, Production, Support & Training

Mob +353 (0)86 250 9631
Tel +353 (0)1 437 1200
Web www.arcdox.com
Email nreilly@arcdox.com
LinkedIn http://ie.linkedin.com/pub/neil-reilly/21/82/103

508 Q-House | Furze Road | Sandyford | Dublin 18 | Ireland

RIAI (Royal Institute of Architects Ireland)Registered Architectural Practice.
Please click here to view our Email Disclaimer.
0 Likes
Message 15 of 20

Anonymous
Not applicable

sorry but how do i use this script in revit?

0 Likes
Message 16 of 20

Anonymous
Not applicable
Accepted solution
You'll need RevitPythonShell installed to be able to run this script
inside the shell.

https://github.com/architecture-building-systems/revitpythonshell
Message 17 of 20

Anonymous
Not applicable

thanks.

but IT guys prohibit us from installing third party softwares / add-ins

0 Likes
Message 18 of 20

Anonymous
Not applicable

Thanks for this suggestion. How long did the script run in Python to delete your 12,000 lines? I am trying it now and have been waiting about 20 minutes to delete one line type, of which there were hundreds, and wondering how to tell if it is working.

 

Thanks!

0 Likes
Message 19 of 20

Anonymous
Not applicable
It took the script the first time I had ran it about 7 hours to churn through them. Another time it took 20 minutes. No idea why.



Sent from my Samsung Galaxy smartphone.
0 Likes
Message 20 of 20

sarah.hay10
Explorer
Explorer

Was there ever a solution for the greyed out "delete" option, other than running a script? As someone else stated, my IT will not allow the third-party software to run a script.

 

My issue isn't 12000 line types. It's like 10, so if there is a manual solution it is doable.

 

One post said its because it is reference somewhere in the file, but I've went through the file and can't find it anywhere.

 

Thanks in advance for your time and help with this matter! - Sarah

0 Likes