Skip to content

Instantly share code, notes, and snippets.

View chuongmep's full-sized avatar
👋
Loading...

Chuong Ho chuongmep

👋
Loading...
View GitHub Profile
public static List<XYZ> ComputeConvexHull(List<XYZ> points)
{
if (points == null || points.Count < 3)
throw new ArgumentException("At least 3 points are required to compute a convex hull");
List<XYZ> hull = new List<XYZ>();
// Find the leftmost point
XYZ leftmost = points[0];
foreach (var point in points)
import psutil
def get_all_ports():
ports = set()
for proc in psutil.process_iter(['pid', 'name']):
try:
connections = proc.net_connections()
for conn in connections:
if conn.laddr.port:
ports.add(conn.laddr.port)
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.DB.Analysis;
[Transaction(TransactionMode.Manual)]
public class PickCurveAndCreateDirectShape : IExternalCommand
{
public Result Execute(
class ModelData2 {
constructor(viewer) {
this._modelData = {};
this._viewer = viewer;
}
init(callback) {
let _this = this;
_this.getAllLeafComponents(function (dbIds) {
let count = dbIds.length;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// get all reference with connector 1
List<Autodesk.Revit.DB.Connector> connectorSets = connectors1.Select(x => x.AllRefs)
.SelectMany(x => x.Cast<Autodesk.Revit.DB.Connector>())
.ToList();
// disconnect all reference with connector 1
connectors1.ForEach(x =>
{
connectorSets.ForEach(a =>
{
if (x.IsConnectedTo(a))
[01/08/2024 09:07:40] Job information:
{
"CommandLine": [
"$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[inputFile].path)\" /al \"$(appbundles[TestDynamoRevitDA].path)\""
],
"Settings": {
"script": {},
"dasOpenNetwork": {
"value": "true",
"isEnvironmentVariable": true
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
TypeId UnitLabel Version
autodesk.unit.unit:1ToRatio 1: 1.0.1
autodesk.unit.unit:acres acres 1.0.1
autodesk.unit.unit:amperes A 1.0.0
autodesk.unit.unit:atmospheres atm 1.0.1
autodesk.unit.unit:bars bar 1.0.1
autodesk.unit.unit:britishThermalUnits Btu 1.0.1
autodesk.unit.unit:britishThermalUnitsPerDegreeFahrenheit BTU/°F 1.0.1
autodesk.unit.unit:britishThermalUnitsPerHour Btu/h 1.0.1
autodesk.unit.unit:britishThermalUnitsPerHourCubicFoot Btu/(h·ft³) 1.0.1
public override void Action()
{
// get all forgetypeUnit
IList<ForgeTypeId> forgeTypeIds = UnitUtils.GetAllUnits();
List<UnitsData> UnitDict = new List<UnitsData>();
foreach (var forgeTypeId in forgeTypeIds)
{
// get label symbol
var symbol = FormatOptions
.GetValidSymbols(forgeTypeId).FirstOrDefault(x => x.Empty() == false);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.