-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBT_UC_autolisp.lsp
438 lines (349 loc) · 18.3 KB
/
BT_UC_autolisp.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
;Vitalis, BT Tetragonal Unit Cell Design
;First change Autocad Units to radians
;import geometric data
(arxload "geom3d")
(setq L 6.7); 7.23mm for 75deg, 6.7mm for 80deg, 6.295mm for 85deg
(setq cylRadius 0.5)
(setq angle_set 1.39626);1.309 radians = 75deg, 1.39626 = 80deg, 1.48353 = 85deg radians, 1.5708 = 90deg
(setq n 4)
(setq m 5)
;define tan
(defun tan (num)
(/ (sin
num)(cos num))
)
(vl-load-com)
(setq factor (/ (tan angle_set) (- (* 4.0 (tan angle_set)) (* 4.0 (sin angle_set))))); factor between the size of vertical struts to the unitcell height
(setq a (/ L (* 2.0 factor))); x-axis length of the unit cell
(setq b (- a (* (* 2.0 factor) a)))
(setq x (* (* (* 4 (sin angle_set)) factor) a))
(setq y (* (* (* 4 (sin angle_set)) factor) a))
(setq z (+ (* (* 2 factor) a) (- 1 (* factor a))))
;first column id=1
(setq cylHeight_1 (* factor a))
(setq z_1 (/ cylHeight_1 2))
(setq center (vlax-3d-point 0 0 z_1))
(setq modelSpace (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;second column id=2
(setq center (vlax-3d-point 0 (* (* (* 4 (sin angle_set)) factor) a) z_1))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;third column id=3
(setq center (vlax-3d-point (* (* (* 4 (sin angle_set)) factor) a) (* (* (* 4 (sin angle_set)) factor) a) z_1))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;forth column id=4
(setq center (vlax-3d-point (* (* (* 4 (sin angle_set)) factor) a) 0 z_1))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;fifth column id=5
(setq x_5 (* (* (* 2.0 (sin angle_set)) factor) a))
(setq center (vlax-3d-point x_5 x_5 z_1))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
;diagonal elements
;calculate cylinder height
(setq cylHeight_diag (* 2 (* factor a)))
;calculate and place location for diagonal element id=6
(setq z_diag (- (* factor a) (/ (* (* (* 1.0 (sin angle_set)) factor) a) (tan angle_set))))
(setq center (vlax-3d-point (* (* (* 1.0 (sin angle_set)) factor) a) 0 z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate and cut
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 1.0 (sin angle_set)) factor) a) 1 z_diag))
(setq endp (list (* (* (* 1.0 (sin angle_set)) factor) a) -1 z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=7
(setq center (vlax-3d-point (* (* (* 3.0 (sin angle_set)) factor) a) 0 z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate and cut
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 3.0 (sin angle_set)) factor) a) -1.0 z_diag))
(setq endp (list (* (* (* 3.0 (sin angle_set)) factor) a) 1.0 z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=8
(setq center (vlax-3d-point (* (* (* 1.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate abd cut
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 1.0 (sin angle_set)) factor) a) 1 z_diag))
(setq endp (list (* (* (* 1.0 (sin angle_set)) factor) a) -1 z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=9
(setq center (vlax-3d-point (* (* (* 3.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate and cut
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 3.0 (sin angle_set)) factor) a) -1 z_diag))
(setq endp (list (* (* (* 3.0 (sin angle_set)) factor) a) 1 z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=10
(setq center (vlax-3d-point 0 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate and cut
(setq ss1 (ssget "L"))
(setq stp (list -1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(setq endp (list 1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=11
(setq center (vlax-3d-point 0 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate and cut
(setq ss1 (ssget "L"))
(setq stp (list 1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(setq endp (list -1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=12
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate and cut
(setq ss1 (ssget "L"))
(setq stp (list 1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(setq endp (list -1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=13
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate nad cut
(setq ss1 (ssget "L"))
(setq stp (list -1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(setq endp (list 1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=14
(setq center (vlax-3d-point (* (* (* 1.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 1.0 (sin angle_set)) factor) a) -1 z_diag))
(setq endp (list (* (* (* 1.0 (sin angle_set)) factor) a) 1 z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=15
(setq center (vlax-3d-point (* (* (* 3.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 3.0 (sin angle_set)) factor) a) 1 z_diag))
(setq endp (list (* (* (* 3.0 (sin angle_set)) factor) a) -1 z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=16
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list 1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(setq endp (list -1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=17
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list -1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(setq endp (list 1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag))
(ROTATE3D ss1 stp endp angle_set)
;Upper section
;column id=18
(setq z_upper (- a (/ (* factor a) 2)))
(setq center (vlax-3d-point 0 0 z_upper))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;column id=19
(setq center (vlax-3d-point 0 (* (* (* 4.0 (sin angle_set)) factor) a) z_upper))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;column id=20
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) z_upper))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;column id=21
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) 0 z_upper))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
(setq ss1 (ssget "L"))
;column id=22
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) z_upper))
(vla-AddCylinder modelSpace center cylRadius cylHeight_1)
;diagonal elements
;calculate and place location for diagonal element id=23
(setq z_diag_up (+ (+ b (* factor a)) (/ (* (* (* 1.0 (sin angle_set)) factor) a) (tan angle_set))))
(setq center (vlax-3d-point (* (* (* 1.0 (sin angle_set)) factor) a) 0 z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 1.0 (sin angle_set)) factor) a) -1 z_diag_up))
(setq endp (list (* (* (* 1.0 (sin angle_set)) factor) a) 1 z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=24
(setq center (vlax-3d-point (* (* (* 3.0 (sin angle_set)) factor) a) 0 z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 3.0 (sin angle_set)) factor) a) 1 z_diag_up))
(setq endp (list (* (* (* 3.0 (sin angle_set)) factor) a) -1 z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=25
(setq center (vlax-3d-point (* (* (* 1.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 1.0 (sin angle_set)) factor) a) -1 z_diag_up))
(setq endp (list (* (* (* 1.0 (sin angle_set)) factor) a) 1 z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=26
(setq center (vlax-3d-point (* (* (* 3.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 3.0 (sin angle_set)) factor) a) 1 z_diag_up))
(setq endp (list (* (* (* 3.0 (sin angle_set)) factor) a) -1 z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=27
(setq center (vlax-3d-point 0 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list 1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(setq endp (list -1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=28
(setq center (vlax-3d-point 0 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list -1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(setq endp (list 1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=29
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list -1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(setq endp (list 1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=30
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list 1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(setq endp (list -1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=31
(setq center (vlax-3d-point (* (* (* 1.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 1.0 (sin angle_set)) factor) a) 1 z_diag_up))
(setq endp (list (* (* (* 1.0 (sin angle_set)) factor) a) -1 z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=32
(setq center (vlax-3d-point (* (* (* 3.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list (* (* (* 3.0 (sin angle_set)) factor) a) -1 z_diag_up))
(setq endp (list (* (* (* 3.0 (sin angle_set)) factor) a) 1 z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=33
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list 1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(setq endp (list -1 (* (* (* 3.0 (sin angle_set)) factor) a) z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;calculate and place location for diagonal element id=34
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(vla-AddCylinder modelSpace center cylRadius cylHeight_diag)
;rotate
(setq ss1 (ssget "L"))
(setq stp (list -1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(setq endp (list 1 (* (* (* 1.0 (sin angle_set)) factor) a) z_diag_up))
(ROTATE3D ss1 stp endp angle_set)
;long section
;column id=35
(setq cylHeight_long (* 2 (* a factor)))
(setq z_long (+ (* factor a) (/ b 2)))
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) 0 z_long))
(vla-AddCylinder modelSpace center cylRadius cylHeight_long)
(setq ss1 (ssget "L"))
;column id=36
(setq center (vlax-3d-point 0 (* (* (* 2.0 (sin angle_set)) factor) a) z_long))
(vla-AddCylinder modelSpace center cylRadius cylHeight_long)
(setq ss1 (ssget "L"))
;column id=37
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) z_long))
(vla-AddCylinder modelSpace center cylRadius cylHeight_long)
(setq ss1 (ssget "L"))
;column id=38
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) z_long))
(vla-AddCylinder modelSpace center cylRadius cylHeight_long)
(setq ss1 (ssget "L"))
;Spheres
;Corner Spheres Down
(setq center (vlax-3d-point 0 0 (* factor a)))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) 0 (* factor a)))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) (* factor a)))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point 0 (* (* (* 4.0 (sin angle_set)) factor) a) (* factor a)))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
;Corner Spheres Up
(setq center (vlax-3d-point 0 0 (- a (* factor a))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) 0 (- a (* factor a))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) (- a (* factor a))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point 0 (* (* (* 4.0 (sin angle_set)) factor) a) (- a (* factor a))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
;Cross Spheres Down
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) (* factor a)))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) (- a (* factor a))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
;Middle of Struts Down
(setq center (vlax-3d-point 0 (* (* (* 2.0 (sin angle_set)) factor) a) (- (* factor a) (* (* 2 (* factor a) (cos angle_set))))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) 0 (- (* factor a) (* (* 2 (* factor a) (cos angle_set))))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) (- (* factor a) (* (* 2 (* factor a) (cos angle_set))))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) (- (* factor a) (* (* 2 (* factor a) (cos angle_set))))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
;Middle of Struts Up
(setq center (vlax-3d-point (* (* (* 4.0 (sin angle_set)) factor) a) (* (* (* 2.0 (sin angle_set)) factor) a) (+ (- a (* factor a)) (* (* (* factor a) 2) (cos angle_set)))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) (* (* (* 4.0 (sin angle_set)) factor) a) (+ (- a (* factor a)) (* (* (* factor a) 2) (cos angle_set)))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point 0 (* (* (* 2.0 (sin angle_set)) factor) a) (+ (- a (* factor a)) (* (* (* factor a) 2) (cos angle_set)))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
(setq center (vlax-3d-point (* (* (* 2.0 (sin angle_set)) factor) a) 0 (+ (- a (* factor a)) (* (* (* factor a) 2) (cos angle_set)))))
(vla-AddSphere modelSpace center cylRadius)
(setq ss1 (ssget "L"))
;Union all objects
(setq ss (ssget "X"))
(COMMAND "UNION" ss "")
;Array all objects
; (command "_ARRAY" ss "" "R" n n x y)
; (setq ss (ssget "X"))
; (COMMAND "UNION" ss "")