Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNX 671 Local Axes of Structural Objects #3648

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ ref m3
numberOfResults,
null,
loadCase,
(int i) => (float)(objSta[i] / lengthOf1dElement),
(int i) => (float)(objSta[i] / lengthOf1dElement), // Dangerous. We are not validating if lengthOf1dElement != 0
p,
v2,
v3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public static void SetLoadCombinationsForResults(cSapModel sapModel, Dictionary<
loadCasesCommaSeparated = string.Empty;
}

// This approach is NOT ideal. What if the load combination name has a comma in it?
string[] loadCases = loadCasesCommaSeparated.Split(',').Select(s => s.TrimStart()).ToArray();

var numberOfLoadCombinations = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ public void SetFrameElementProperties(Element1D element1D, string newFrame, ILis
Model.FrameObj.SetSection(newFrame, propertyName);
}

if (element1D.orientationAngle != null)
if (element1D.orientationAngle != 0)
{
Model.FrameObj.SetLocalAxes(newFrame, element1D.orientationAngle);
Model.FrameObj.SetLocalAxes(newFrame, element1D.orientationAngle * (180 / Math.PI)); // Convert from radians to degrees
}
end1Release = end1Release.Select(b => !b).ToArray();
end2Release = end2Release.Select(b => !b).ToArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ private Element1D AnalyticalStickToSpeckle(AnalyticalModelStick revitStick)
speckleElement1D.end1Offset = VectorToSpeckle(startOffset, revitStick.Document);
speckleElement1D.end2Offset = VectorToSpeckle(endOffset, revitStick.Document);

speckleElement1D.orientationAngle = revitStick.get_Parameter(BuiltInParameter.ANALYTICAL_MODEL_ROTATION)?.AsDouble() ?? 0.0; // Default to 0.0 if null or parameter not found, in radians

SetEndReleases(revitStick, ref speckleElement1D);

var prop = new Property1D();
Expand Down Expand Up @@ -360,6 +362,7 @@ private Element1D AnalyticalStickToSpeckle(AnalyticalMember revitStick)
}

speckleElement1D.baseLine = CurveToSpeckle(revitStick.GetCurve(), revitStick.Document) as Objects.Geometry.Line;
speckleElement1D.orientationAngle = revitStick?.CrossSectionRotation ?? 0; // In radians

SetEndReleases(revitStick, ref speckleElement1D);

Expand Down