![]() ![]() / /// Return true if the three vectors a, b and c /// form a right handed coordinate system, i.e. Return a.CrossProduct( b ).DotProduct( c ) / static double SignedParallelipedVolume( In German, /// this is also known as Spatprodukt. / /// Return the signed volume of the paralleliped /// spanned by the vectors a, b and c. Here are the two little one-line helper methods implementing this: This is also called Spatprodukt in German. That volume is calculated by forming the cross product of the first two, then forming the dot product between the result and the third. Well, the coordinate system is right handed if and only if the signed volume of the parallelepiped they span is positive. If necessary, swap Y and Z to form a right-handed coordinate system.ĭetermining Coordinate System Right-HandednessĪh, yes, before we get to that, how do we determine whether the three vectors form a right-handed coordinate system?.Find the three other lines starting or ending at the origin, and use them to define the Y and Z axes. ![]() Pick an arbitrary line as the X axis and its starting point as the origin.The only information we can obtain from the scope box are its 12 boundary lines. It returns the minimal aligned bounding box for a Revit scope box element. I implemented a sample command SetSectionBox to test the concept, and a method GetScopeBoxBoundingBox to extract the scope box line geometry data, create a bounding box from that, and assign it to the view section box. You need to figure out the exact size and orientation from those twelve lines, and then decide how they should determine the view section box. The scope box Location property data is not accessible, so you can't use that.Īs far as I can tell, the only thing you have to go by is its geometry definition.Įxploring the scope box geometry in RevitLookup, you can see that it consists of exactly twelve lines, the edges of the scope box Step 1 requires reading and interpreting the scope box data. Step 2 is demonstrated by the discussion on how to is trivial: you simply say view.SectionBox = newSectionBox as shown below. Set up the required view SectionBox bounding box data, i.e.Extract the required data from the scope box.Our goal is to programmatically relocate and rotate the section box so it is at the same location and angle as the scope box, and also make the size of the section box the same as the scope box.Īnswer: You need to implement the following workflow, or rather data flow: The 3D view SectionBox property is checked, so the view SectionBox is also shown, using solid lines.īoth are selected, and thus highlighted in blue: Question: Here is a model in 3D view containing a scope box represented by the dotted lines. Here is the discussion that led up to this solution: To manipulate an existing view instead of creating a new one, you simply set up the bounding box in the same way and assign it to the view SectionBox property as shown below. In that post, it is fed into the CreateSection method. a transform plus minimum and maximum values describing the location, orientation and size of the box. The key is setting up the view SectionBox property properly. I actually already showed how to set up a view section box discussing how toĬreate a section view parallel to a wall. specifying exactly how the model is cut in the current 3D view. In fact, we show how to use the manually adjusted scope box to define the view section box, i.e. How to set the exact geometric location, size and orientation of the 3D view section box.How to retrieve the exact geometric location, size and orientation of the scope box.Here is a case that I really like, demonstrating two interesting aspects: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |