Skip to content

Commit adf1576

Browse files
feat: create new truncate_assembly component
1 parent 953f5f4 commit adf1576

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from ghpythonlib.componentbase import executingcomponent as component
2+
3+
import diffCheck
4+
import diffCheck.df_geometries
5+
6+
class DFTester(component):
7+
def RunScript(self,
8+
i_assembly,
9+
i_truncate_index: int):
10+
beams = i_assembly.beams[:i_truncate_index]
11+
name = i_assembly.name
12+
13+
o_assembly = diffCheck.df_geometries.DFAssembly(name=name, beams=beams)
14+
ghenv.Component.Message = f"number of beams: {len(o_assembly.beams)}" # noqa: F821
15+
return o_assembly
6.92 KB
Loading
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "DFTruncateAssembly",
3+
"nickname": "TruncateAssembly",
4+
"category": "diffCheck",
5+
"subcategory": "Structure",
6+
"description": "This component truncates an assembly.",
7+
"exposure": 4,
8+
"instanceGuid": "cf8af97f-dd84-40b6-af44-bf6aca7b941b",
9+
"ghpython": {
10+
"hideOutput": true,
11+
"hideInput": true,
12+
"isAdvancedMode": true,
13+
"marshalOutGuids": true,
14+
"iconDisplay": 2,
15+
"inputParameters": [
16+
{
17+
"name": "i_assembly",
18+
"nickname": "i_assembly",
19+
"description": "The assembly to be truncated.",
20+
"optional": false,
21+
"allowTreeAccess": true,
22+
"showTypeHints": true,
23+
"scriptParamAccess": "item",
24+
"wireDisplay": "default",
25+
"sourceCount": 0,
26+
"typeHintID": "ghdoc"
27+
},
28+
{
29+
"name": "i_truncate_index",
30+
"nickname": "i_truncate_index",
31+
"description": "The index at which to truncate the assembly.",
32+
"optional": false,
33+
"allowTreeAccess": false,
34+
"showTypeHints": true,
35+
"scriptParamAccess": "item",
36+
"wireDisplay": "default",
37+
"sourceCount": 0,
38+
"typeHintID": "int"
39+
}
40+
],
41+
"outputParameters": [
42+
{
43+
"name": "o_assembly",
44+
"nickname": "o_assembly",
45+
"description": "The resulting assembly after truncation.",
46+
"optional": false,
47+
"sourceCount": 0,
48+
"graft": false
49+
}
50+
]
51+
}
52+
}

0 commit comments

Comments
 (0)