Create dimension to wall centerline, center of core, faces of core

Create dimension to wall centerline, center of core, faces of core

boostyourbim
Advocate Advocate
11,457 Views
53 Replies
Message 1 of 54

Create dimension to wall centerline, center of core, faces of core

boostyourbim
Advocate
Advocate

I'm trying to create dimensions to walls via the API. It is possible to get a reference to a wall's centerline, center of core, and faces of core? These options are avaiable when creating dimensions in the Revit UI.

0 Likes
11,458 Views
53 Replies
Replies (53)
Message 2 of 54

jeremytammik
Autodesk
Autodesk

Dear Boostyourbim,

 

I have heard about this and similar issues in the past and think they were rsolved recently...

 

Have you checked whether the Options.IncludeNonVisibleObjects property returns the features you need?

 

You obviously also have to set Options.ComputeReferences to true.

 

If nothing else helps, you might have to create a place holder model line, keep it up to date with the wall using DMU, and dimension to that...

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 54

boostyourbim
Advocate
Advocate

Thanks Jeremy. The attached code is able to create the dimension shown in red in the screenshot. This includes the center of core and wall centerline. However, it raises two questions:

 

  1. Two of the faces have a null reference. These appear to be the faces of the core centerline. Any idea how to get these references or is this a bug in the API?
  2. What's the best way to differentiate the core centerline face & the wall centerline face? Some geometric analysis of faces & distances between origins is possible, but what about when these two faces are coincident? It still matters which is which because the wall structure can be modified so the core centerline moves off the wall centerline.

Would you agree that ideally there would be these new methods added to HostObjectUtils? GetCoreFaces(), GetCoreCenterline(), GetCenterline()

0 Likes
Message 4 of 54

jeremytammik
Autodesk
Autodesk

Dear Boostyourbim,

 

Thanks for exploring further.

 

I'll take a look.

 

Happy weekend!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 54

jeremytammik
Autodesk
Autodesk

Ah; one of the three methods you suggest is superfluous: GetCenterline() is not needed, because the wall location line is always at the wall centre, isn't it?



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 6 of 54

boostyourbim
Advocate
Advocate
But the reference of the LocationCurve.Curve is null, and the use case here is to get references that can be used to create dimensions.

Element e = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element));
LocationCurve lc = e.Location as LocationCurve;
Reference lcRef = lc.Curve.Reference;
0 Likes
Message 7 of 54

BobbyC.Jones
Advocate
Advocate

Any traction on this one?  I'm also working on automating some dimensioning and dimensioning the core is somewhat important  🙂

--
Bobby C. Jones
0 Likes
Message 8 of 54

jeremytammik
Autodesk
Autodesk

Dear Bobby,

 

I fully concur!

 

But don't hold you breath...

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 9 of 54

Anonymous
Not applicable

thats sad ;(

0 Likes
Message 10 of 54

Moustafa_K
Collaborator
Collaborator

Hello

is there any resolution for this?? 😞  Practically we always issue dimensions to the face of the core. and like boostyourbim said, while snooping a ui dimension it showed a reference of type none, which i could not find.

 

Thanks

 

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
Message 11 of 54

jeremytammik
Autodesk
Autodesk

Dear Moustafa,

 

Hmmm.

 

I seem to remember seeing some suggestion to help with this situation in another thread.

 

Does anyone else remember seeing this?

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 12 of 54

BobbyC.Jones
Advocate
Advocate
AFAIK, still no solution to obtaining dimensionable references to the core.
--
Bobby C. Jones
0 Likes
Message 13 of 54

jeremytammik
Autodesk
Autodesk

Dear Harry, Moustafa and Bobby,

 

The internal issue REVIT-86488 [Make core centerline a reference] has been resolved and scheduled for inclusion in the next major release of Revit.

 

I am checking two aspects with the development team:

 

1. The enhancement was made for some picking and snapping operation. Will it also be useful for dimensioning?

2. Can this enhancement also be made available in Revit 2017?

 

I'll let you know as soon as I hear back from them.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 14 of 54

BobbyC.Jones
Advocate
Advocate
Jeremy, that is FANTASTIC news! Thank you for tracking this and following up with us.
--
Bobby C. Jones
0 Likes
Message 15 of 54

plaiknst
Participant
Participant

Hi Jeremy.

 

Have you any news about core Centerline?

 

Thanks

0 Likes
Message 16 of 54

jeremytammik
Autodesk
Autodesk

Dear @plaiknst,

 

Thank you for your patience and your timely prompt.

 

Yes, there is some news.

 

Now that I present it here, I see that I have to follow up internally with the development team on this as well.

 

Here is what they say on the issue REVIT-86488 [Make core centerline a reference]:

 

I believe we can also dimension to and align to core centerlines.

 

There is indeed a difference in behaviour between UI and API in the case of core centerlines and core faces. These are not real references, they are artificially injected in the UI in the dimension, align and pick line editors. This is why they are unavailable in the API via the generic reference mechanisms.

 

The best solution for the UI and API would be to make these real reference and this is what this issue was about. However, we ran into some extra problems when we did that. So we ended up implementing a partial solution for Pick Line, which mimics the already present partial solutions in Align and Dimension editors.

 

The full solution of making the core centerline/faces references can still be implemented, though. I would say for bookkeeping purposes, it would be better to create another issue for that. However, I am not sure that solution would be portable to R2017, though, we need to implement it in R2018 first and see what is the scope of the changes and whether it is acceptable to make them in R2017.

 

On your other questions:

 

>>Two of the faces have a null reference. These appear to be the faces of the core centerline. Any idea how to get these references or is this a bug in the API?

 

Do you mean these are the core exterior faces? Or the core centerline face? I would expect core centerline to only have a single face.

 

>> What's the best way to differentiate the core centerline face & the wall centerline face? Some geometric analysis of faces & distances between origins is possible, but what about when these two faces are coincident? It still matters which is which because the wall structure can be modified so the core centerline moves off the wall centerline.

 

>> Would you agree that ideally there would be the following new methods added to HostObjectUtils? GetCoreFaces(), GetCoreCenterline(), GetCenterline()

 

In the Revit internals, these are distinguished by geometry tags. Not sure if that is possible in the API.

 

I think your suggestion about specific methods to get those references is reasonable, but let's first see if there is another established way to do that.

 

We ported this to 2017 SP2 and 2017 R2. However, as said, these are only available in the UI.

 

I'll follow up with them on the progress to date and see what we can do to get as much functionality as possible available through the API as well.

 

Keep prompting, please  🙂

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 17 of 54

aricke59
Enthusiast
Enthusiast

Hi Jeremy, has there been any movement on getting references to the wall core faces and centrelines?

 

Using element.geometry(options) with includenonvisibleobjects set to true I can get the core centre and core faces however these do not have an associated reference and therefore using them for dimensioning is not possible.

 

On a similar vein, hopefully simpler, is it possible to retrieve references to the layers of a wall to enable dimensioning? I've been looking high and low and cannot find anything to get references to these items so that I can dimension each layer of the wall.

 

As a possibility perhaps element.geometry could have an option that returns each layer as solids rather than just the overall solid.

 

Regards, Andreas

0 Likes
Message 18 of 54

jeremytammik
Autodesk
Autodesk

Dear Andreas,

 

Yes:

 

References and selection of subelements:

 

 

http://thebuildingcoder.typepad.com/blog/2017/04/whats-new-in-the-revit-2018-api.html#2.2.3

 

API access to FamilyInstance references:

 

http://thebuildingcoder.typepad.com/blog/2017/04/whats-new-in-the-revit-2018-api.html#3.19

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 19 of 54

aricke59
Enthusiast
Enthusiast

Hi Jeremy,

 

I checked out your suggestions however I'm not certain that it addresses what I wish to do. My desired workflow is to 

 

1. Select a wall(s) by picking two points and finding all walls between those points - All working fine.

2. Get references to each layer in the wall(s). I then use these references to create dimensions.

 

I tried using wall.getsubelements but this returned nothing.

 

The approach you suggested seems to be more about selecting subelements with a pick command. 

 

Am I missing something?

0 Likes
Message 20 of 54

jeremytammik
Autodesk
Autodesk

Dear Andreas,

I think and hope you are, yes.

 

I mentioned two things:

 

  • References and selection of subelements -- about selecting subelements with a pick command.
  • API access to FamilyInstance references -- about retrieving references to family instance internals, e.g., maybe, wall centre lines, hopefully exactly what you need.

 

I hope this helps.

 

Cheers,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes