Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
.NET
»
Topic:
change 3Dsolid Extrude distance
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: change 3Dsolid Extrude distance (Read 2752 times)
0 Members and 1 Guest are viewing this topic.
WOWENS
Newt
Posts: 64
change 3Dsolid Extrude distance
«
on:
July 06, 2023, 05:19:50 PM »
I have a 3Dsolid and I want to change the Extrude distance with code,
any ideas on how to do this.
Logged
Bryco
Water Moccasin
Posts: 1883
Re: change 3Dsolid Extrude distance
«
Reply #1 on:
July 06, 2023, 07:40:23 PM »
I extrude bolts from a 2d circle by clicking 2 pts, but I am not sure there is such a thing as an extrude distance. If the shape you are trying to change is always the same shape you might have a chance to do that.
Logged
HOSNEYALAA
Newt
Posts: 107
Re: change 3Dsolid Extrude distance
«
Reply #2 on:
July 25, 2023, 01:00:15 AM »
Hi
Can you attached example drawing
Logged
WOWENS
Newt
Posts: 64
Re: change 3Dsolid Extrude distance
«
Reply #3 on:
July 26, 2023, 02:46:40 PM »
It's a simple beam, I can change the Height with the properties box but I want to access it with .net
Logged
Bryco
Water Moccasin
Posts: 1883
Re: change 3Dsolid Extrude distance
«
Reply #4 on:
August 01, 2023, 02:26:07 PM »
In the object browser there is a AcadExtrudedSurfaceClass that has a get,set height (see Interop.AutoCAD). It may be of some use.
Logged
gile
Gator
Posts: 2520
Marseille, France
WWW
Re: change 3Dsolid Extrude distance
«
Reply #5 on:
August 01, 2023, 05:16:42 PM »
Hi,
You can use the Solid3d.ExtrudeFaces method.
To find the face to be extruded, you can use the Brep API.
Code - C#:
[Select]
private
static
void
ChangeExtrusionHeight
(
Solid3d solid, Vector3d extrusionDirection,
double
newHeight
)
{
var
fullPath
=
new
FullSubentityPath
(
new
[
]
{
solid
.
ObjectId
}
,
new
SubentityId
(
SubentityType
.
Null
, IntPtr
.
Zero
)
)
;
using
(
var
brep
=
new
Brep
(
fullPath
)
)
{
var
face
=
brep
.
Faces
.
Where
(
f
=>
(
(
ExternalBoundedSurface
)
f
.
Surface
)
.
BaseSurface
is
Plane plane
&&
plane
.
Normal
.
IsParallelTo
(
extrusionDirection
)
)
.
Select
(
f
=>
{
var
plane
=
(
Plane
)
(
(
ExternalBoundedSurface
)
f
.
Surface
)
.
BaseSurface
;
return
new
{
f
.
SubentityPath
.
SubentId
, Height
=
Math
.
Abs
(
plane
.
Coefficients
.
D
)
}
;
}
)
.
OrderByDescending
(
x
=>
x
.
Height
)
.
First
(
)
;
solid
.
ExtrudeFaces
(
new
[
]
{
face
.
SubentId
}
, newHeight
-
face
.
Height
,
0.0
)
;
}
}
«
Last Edit: August 02, 2023, 04:36:44 AM by gile
»
Logged
Speaking English as a French Frog
Bryco
Water Moccasin
Posts: 1883
Re: change 3Dsolid Extrude distance
«
Reply #6 on:
August 02, 2023, 02:28:30 PM »
Cool for cats as usual gile
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
change 3Dsolid Extrude distance