Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Unlocking all locked dimensions

4 ANTWORTEN 4
GELÖST
Antworten
Nachricht 1 von 5
Anonymous
6313 Aufrufe, 4 Antworten

Unlocking all locked dimensions

I thought i was being clever by locking everything that was correct so far, but now, of course things is gonna change.

 

After some google searches i only really found a post which is a decade old with the same question, which seemed like a hard no.

 

But is it possible (today) to remove the lock from several or all dimensions at the same time?

 

This guy, from 2009, (https://thebuildingcoder.typepad.com/blog/2009/02/locked-dimensioning.html) writes that the Revit API actually have a 'thing' that can see the locked or not-locked. I'm not a programmer, but i have played with dynamo and maybe someone know of a package or custom-node that can access this?

 

I'm assuming there is a super easy way, and im just an idiot, so i'd like to apologize in advance.

4 ANTWORTEN 4
Nachricht 2 von 5
L.Maas
als Antwort auf: Anonymous

First of all, make sure you create backups before working on this

 

You might try something like this

Dynamo.PNG

Before

Locked.PNG

After

Unlocked.PNG

Checking the article from Jeremy (TheBuildingCoder) it appears that when a dimenison is locked a new constraint item is created. This is exactly what seems to happen. (You can see that some items belong to the category constraints).

 

I use a node to check to which category the (dimension) element belongs. The items belonging to the constraint category do not report back (i.e. empty category parameter), but the items belonging to the category dimension report back nicely. So my assumption is that the elements with empty category parameters are the constraints. As we started with only dimensions I expect that no other type of elements will report back the categroy as empty (something you will have to verify yourself when using on yor project).

I filter out those lements with empty category parameter and then just delete them (a node from archi-lab.net package)

 

I just quickly made this script (no real testing). So when using it on your project make sure that you act on a copy and make sure you have a bakcup until you are sure the script has worked as expected.

 

Script attached in zipfile

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Nachricht 3 von 5
Anonymous
als Antwort auf: L.Maas

This is exactly what i was looking for, thank you so much!

I really appreciate the explanation as well, it helps a lot with understanding everything.

 

Pretty annoying its not a standard feature though, but who needs it when we have awesome people like you ! :leicht_lächelndes_Gesicht:

 

 

Nachricht 4 von 5
Mark.Ackerley
als Antwort auf: Anonymous

If you're a little more cautious and just want to click each dimension to unlock / lock...

 

The end of Jeremy's piece notes the API properties of Dimension.IsLocked and DimensionSegment.IsLocked

 

Hope that's of interest,

 

Mark

 

import clr

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

dim = UnwrapElement(IN[0])
lock = IN[1]

#start transaction
TransactionManager.Instance.EnsureInTransaction(doc)


if dim.NumberOfSegments > 0:
    for dS in dim.Segments:
        dS.IsLocked = lock
else:
    dim.IsLocked = lock

#finish transaction    
TransactionManager.Instance.TransactionTaskDone()

OUT = dim

Lock Dims.gif

Nachricht 5 von 5
kasfe
als Antwort auf: Anonymous

Hello,
I know this is an old thread, but just wanted to share an easier way to solve this issue.

1. In project select all dimensions you wish to unlock.

2. Copy to clipboard.

3. Delete all the selected dimensions and you receive the following dialog box:

kasfe_0-1673949699254.png

Simply press "Unconstrain" and paste the dimensions back from your clipboard. Now they will be unlocked.

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report