Comments (3)
hi @clairekuang thanks for reviewing this. I have pulled a copy the dev branch and from my limited testing so far this looks to provide the parameters that I was expecting.
Reviewing this same wok flow I do have a few other comments, queries but I think I will add these to the community page later in the week.
from speckle-sharp.
public Structure StructureToSpeckle(CivilDB.Structure structure)
{
// get ids pipes that are connected to this structure
var pipeIds = new List<string>();
var pipeNames = new List<string>();
for (int i = 0; i < structure.ConnectedPipesCount; i++)
{
pipeIds.Add(structure.get_ConnectedPipe(i).ToString());
}
Structure speckleStructure = new()
{
location = PointToSpeckle(structure.Location, ModelUnits),
pipeIds = pipeIds,
displayValue = new List<Mesh>() { SolidToSpeckle(structure.Solid3dBody, out List<string> _) },
units = ModelUnits,
//applicationId = structure.Id.ToString()
};
// assign additional structure props
AddNameAndDescriptionProperty(structure.Name, structure.Description, speckleStructure);
try { speckleStructure["grate"] = structure.Grate; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["station"] = structure.Station; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["network"] = structure.NetworkName; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["sumpDepth"] = structure.SumpDepth; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["rimElevation"] = structure.RimElevation; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["sumpDepth"] = structure.SumpDepth; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["sumpElevation"] = structure.SumpElevation; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["wallThickness"] = structure.WallThickness; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["floorThickness"] = structure.FloorThickness; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["rotation"] = structure.Rotation; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["material"] = structure.Material; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["diameterOuter"] = structure.DiameterOrWidth; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["diameterInner"] = structure.InnerDiameterOrWidth; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["lengthOuter"] = structure.Length; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["lengthInner"] = structure.InnerLength; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["height"] = structure.Height; } catch (Exception e) when (!e.IsFatal()) { }
try { speckleStructure["structureId"] = structure.Id.ToString(); } catch (Exception ex) when (!ex.IsFatal()) { }
//try { speckleStructure["structureId"] = structure.Id; } catch (Exception ex) when (!ex.IsFatal()) { }
return speckleStructure;
}
public Pipe PipeToSpeckle(CivilDB.Pipe pipe)
{
// get the pipe curve
ICurve curve;
switch (pipe.SubEntityType)
{
case PipeSubEntityType.Straight:
var line = new Acad.LineSegment3d(pipe.StartPoint, pipe.EndPoint);
curve = LineToSpeckle(line);
break;
default:
curve = CurveToSpeckle(pipe.BaseCurve);
break;
}
Pipe specklePipe = new()
{
baseCurve = curve,
diameter = pipe.InnerDiameterOrWidth,
length = pipe.Length3DToInsideEdge,
displayValue = new List<Mesh> { SolidToSpeckle(pipe.Solid3dBody, out List<string> notes) },
units = ModelUnits,
//applicationId = pipe.Id.ToString()
};
// assign additional pipe props
AddNameAndDescriptionProperty(pipe.Name, pipe.Description, specklePipe);
try { specklePipe["shape"] = pipe.CrossSectionalShape.ToString(); } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["slope"] = pipe.Slope; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["flowDirection"] = pipe.FlowDirection.ToString(); } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["flowRate"] = pipe.FlowRate; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["network"] = pipe.NetworkName; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["startOffset"] = pipe.StartOffset; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["endOffset"] = pipe.EndOffset; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["startStation"] = pipe.StartStation; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["endStation"] = pipe.EndStation; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["startStructure"] = pipe.StartStructureId.ToString(); } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["endStructure"] = pipe.EndStructureId.ToString(); } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["material"] = pipe.Material; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["thickness"] = pipe.WallThickness; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["slope"] = pipe.Slope; } catch (Exception ex) when (!ex.IsFatal()) { }
try { specklePipe["pipeId"] = pipe.Id.ToString(); } catch (Exception ex) when (!ex.IsFatal()) { }
//try { specklePipe["pipeId"] = pipe.Id; } catch (Exception ex) when (!ex.IsFatal()) { }
return specklePipe;
}
from speckle-sharp.
Hey @alex-d-richards , could you take a look at this recent pr that adds PartData
to pipes and structures? It does contain some of the missing properties you mentioned, but perhaps not all of them. Is the information in PartData
enough, or do you require all of the properties?
from speckle-sharp.
Related Issues (20)
- My Fake ticket, testing! HOT 6
- New issue
- ARCHICAD Converter: No BuildingMaterial for Windows and not all Components HOT 3
- ARCHICAD converter: Beams and columns do not have the profile information.
- SetRelationship (in CommitObjectBuilder) throws "an item with the same key has already been added" exception HOT 6
- Enhancement: Civil 3D Corridor Baseline and Cross Section Data HOT 2
- feat(archicad): Add support for openings
- feat(archicad): Add certification to "ConnectorArchicad.exe"
- feat(archicad): Update connector icon on Mac HOT 1
- feat(archicad): Add default commit message
- Civil connector will not allow selection of corridors to push
- Revit floors with slab shape points
- Bug: Rhino Converter throws an error when unnamed collections are filtered HOT 2
- Revit Connector: doesn't apply ParameterUpdater using applicationId HOT 1
- bug(Archicad): Properties of Objects not showing in viewer HOT 2
- Broken link to DesktopUI
- Archicad: Properties are not showing in viewer
- Pushing Civil 3D Corridor shows an error
- Revit connector does not import spaces when the zone of space is null
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speckle-sharp.