Reference Callout - Get Boundary Curves

Hi,

I’m trying to get the boudnary curves of a reference callout.
Usually it is easy with regular view using View.GetCropBoxCurves. The problem with the reference callout is that it is not an actual view - it is just a reference but still it has boudnary curves. One possible approach is what @Dimitar_Venkov suggested for callouts - Objects in Callouts. This works - but the problem is that the bounding box is including also the callout head - image which is not quite right.

I searched for Revit API Method and found this - http://www.revitapidocs.com/2017.1/248f20e0-9735-5733-2c8a-6b871bb17d3b.htm
But I’m not experienced enough for using this with Python. Hope someone can help me with this and sucsessfully to get the curves of reference callout

1 Like

The only way to get this information is with Python. I recommend trying to use the API method you found. It’s definitely worth getting yourself familiar with Python.

Yes, I know that learning Python will be good investment =) I already know the basics but some methods are difficult.
Tomorrow I will share my progress and what errors I get. Hope someone will give me a clue how to fix the script.
Cheers!

Hi There,
I managed to implement the API method and make the Python Script

I also used the code inside View.GetCropBoxCurves node from MEPover package.
Thanks!

2 Likes

Exactly what I was looking for! Thanks

hi all
i wright this script and it come with this error

i try to make a callout from the outline of some scope boxes i Create the views that i need for the callout and i just want to make a call out refer to the views that i Created

any help
thanks

Please share the code inside the Python Script node. It seems that you didn’t define the “uiapp” variable.

import clr
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitAPIUI’)
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

doc = DocumentManager.Instance.CurrentDBDocument
uoapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

clr.AddReference(“RevitNodes”)
import Revit

#The inputs to this node will be stored as a list in the IN variables.
if isinstance(IN[0], list):
callouts = UnwrapElement(IN[0])
toggle = 0
else:
callouts= UnwrapElement(IN[0])
toggle = 1

listout =
regions=
for x in callout:
regions=View.GetCropRegionShapeManagerForReferenceCallout
(doc,x.Id).GetCropShape()
if len(regions) > 0:
lines = [t.ToProtoType() for y in regions[0]]
listout.append(lines)
else:
listout.append()

#Assign your output to the OUT variable.
if toggle == 0:
OUT = listout
else:
OUT = lines

hi @Petar_Penchev1
i just Create a code that make a call out from scope box but my issue that i want to make this call out reference other view


thanks

You could use this method - https://www.revitapidocs.com/2015/f4eda97d-14a0-c657-c916-83da00add998.htm . But you will need to adopt it using Python.
You need different creation process. Because the referencing can’t be done after the callout is created.

1 Like

thanks @ Petar_Penchev1 for your replay and your time but i can use dynamo node only i didn’t know python :frowning:

Sorry about that, you may search for Dynamo node which somebody already created - but there is no such a node as far as I know. I recommend you to start exploring different options for learning Python = ) There are a lot of online recourses - for example - https://learndynamo.com/ . It is good starting point. Good luck!