Modify Section and Callout

Modify Section and Callout

strsuraj
Enthusiast Enthusiast
650 Views
2 Replies
Message 1 of 3

Modify Section and Callout

strsuraj
Enthusiast
Enthusiast

Hi,

 

I am trying to modify the rectangular box - scopeBox of a section and also callout. Using the below code I was able to modify "Far Clip Offset" of Section. (marked in yellow)

 

Parameter vFarclip = currentView.get_Parameter(BuiltInParameter.VIEWER_BOUND_OFFSET_FAR);
                                    vFarclip.SetValueString("2500");

Please find the image.

section_callout.jpg

 

But the other 2 edges Right side and Left side (marked in Red), I was not able to access.

 

Same for the callout.

 

Can anybody guide on how to access these properties for Callout and Section .

 

Thanks

 

 

 

 

 

0 Likes
651 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

The Building Coder has shared a whole bunch of discussions and samples on creating and setting up section views:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.38

 

They ought to cover all you need.

 



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

0 Likes
Message 3 of 3

strsuraj
Enthusiast
Enthusiast

Thanks @jeremytammik for pointing the right place.

 

I have done this change but couldn't really succeed.

 

 

currentView = viewElement as Autodesk.Revit.DB.View;
if (currentView.Name == viewName)
{
// my current sectionBox
BoundingBoxXYZ sectionBox= currentView.get_BoundingBox(currentView);
// updating max and min points for the current sectionBox sectionBox.Max = new XYZ(100,100,0); sectionBox.Min = new XYZ(0,0,0);
Transform oTrans = Transform.Identity; XYZ oMidPt = 0.5 * (sectionBox.Max + sectionBox.Min); oTrans.Origin = oMidPt; XYZ oDirZ = sectionBox.Transform.BasisZ; XYZ oDirX = sectionBox.Transform.BasisX; XYZ oDirY = sectionBox.Transform.BasisY; oTrans.BasisX = oDirX; oTrans.BasisY = oDirY; oTrans.BasisZ = oDirZ; sectionBox.Transform = oTrans;
}

 

Basically I am trying to update the max and min value of current section box and keeping the origin, Basis X Y and Z similar. And finally transforming the section box with these values. Is my approach wrong ?

 

Thanks.

 

0 Likes