Creating extrusion - unexpected internal error: Code 1

Creating extrusion - unexpected internal error: Code 1

isc01
Contributor Contributor
1,617 Views
3 Replies
Message 1 of 4

Creating extrusion - unexpected internal error: Code 1

isc01
Contributor
Contributor

Hello

 

I got a Problem while creating an extrusion. First sample is working, second not.

 

Working:

 

oCurves = oApp.NewCurveArray()
oArrCurves = oApp.NewCurveArrArray

oCurves.Append(Line.CreateBound(New XYZ(dRadius, 0, 0), New XYZ(0, 0, 0)))
oCurves.Append(Line.CreateBound(New XYZ(0, 0, 0), New XYZ(0, -dRadius, 0)))
oCurves.Append(Arc.Create(New XYZ(0, 0, 0), dRadius, DegreeToRadiant(270), DegreeToRadiant(360), New XYZ(1, 0, 0), New XYZ(0, 1, 0)))

oArrCurves.Append(oCurves)

oExtrusion = moActFamily.NewExtrusion(True, oArrCurves, mosketchPlane__2, dHeight)

Not working: - Exits with "unexpected internal error: Code 1"

 

oCurves = oApp.NewCurveArray()
oArrCurves = oApp.NewCurveArrArray


oCurves.Append(Line.CreateBound(New XYZ(0, 0, 0), New XYZ(dRadius, 0, 0)))
oCurves.Append(Line.CreateBound(New XYZ(0, 0, 0), New XYZ(0, dRadius, 0)))
oCurves.Append(Arc.Create(New XYZ(0, 0, 0), dRadius, DegreeToRadiant(0), DegreeToRadiant(90), New XYZ(0, 1, 0), New XYZ(1, 0, 0)))


Dim oDetCurve As ModelCurve = Nothing
oArrCurves.Append(oCurves)
oExtrusion = moActFamily.NewExtrusion(True, oDoor, mosketchPlane__2, dHeight)

What am I doing wrong??

Thanks

 

 

0 Likes
Accepted solutions (1)
1,618 Views
3 Replies
Replies (3)
Message 2 of 4

aignatovich
Advisor
Advisor

Hi!

 

I think, the reason is that your second curveloop is not continuous

0 Likes
Message 3 of 4

isc01
Contributor
Contributor

Hi

 

Not sure:

 

Looking at the 2D I can't see, why I am not able to create a Extrusion out of example 2. Example 1 is no Problem. If i draw the lines of example 2 via the api and than create the Extrusion manually in revit it works.:

Img 1 = Lines example 1

Img 2 = Extrusion example 1

Img 3 = lines example 2

 

Lines1.pngExtrusion1.pngLines2.png

0 Likes
Message 4 of 4

aignatovich
Advisor
Advisor
Accepted solution

Hi!

 

The end of the first line in the curveloop should be the beginning of the second line, the end of second line in the curveloop should be the beginning of the third line in the curveloop and so on.

 

This rule is broken in the second example

0 Likes