其实我以上的代码就是我录的一段journal的改写,下面也贴出来了(是VB的,很简单),大家有兴趣,可以对照一下。作者: supergirl 时间: 2005-6-12 18:10
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
' ----------------------------------------------
' Menu: Insert->Design Feature->Block...
' ----------------------------------------------
Dim nullFeatures_Feature As Features.Feature = Nothing
Dim features_BlockFeatureBuilder1 As Features.BlockFeatureBuilder
features_BlockFeatureBuilder1 = theSession.Parts.Work.Features.CreateBlockFeatureBuilder(nullFeatures_Feature)
Dim point3d1 As Point3d = New Point3d(0.0, 0.0, 0.0)
features_BlockFeatureBuilder1.SetOriginAndLengths(point3d1, "100", "100", "100")
Dim point3d2 As Point3d = New Point3d(52.9603562236931, 26.0351147684603, 100.0)
Dim iSurface1 As ISurface = CType(features_Feature1.FindObject("FACE 1"), ISurface)