Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dowel Symbol Automatic Scaling

Status
Not open for further replies.

ramakrishna90589

Automotive
May 13, 2013
19
IN
Hello,


I am inserting a dowel hole symbol on drafting using custom symbol library and making it associated to a hole using Origin tool, till here everything is fine. but when ever i change the hole size then i have to scale the custom symbol manually. is there any way to link the scale of custom symbol to Hole diameter?. Currently we are using NX 7.5.

Thanks in advance
Ram
 
Replies continue below

Recommended for you

So are you attempting to make the symbol the same size as the hole?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
There is no way to associatively link the size of a Dowel Symbol to the size of a hole. The size of symbols are not parametric, that is the size value entered is not controlled by an expression.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Hi john,

Is it possible to create a dowel symbol using Cross hatch. i mean can we add dowel type fill symbol in xhatch.chx file so that it will be associated with hole all the way.

please suggest

yours curiously,
Ram
 
Instead of a custom symbol, perhaps you could create what you want with a sketch and add it to your reuse library. I'm not sure how well reusable sketches work in the drafting environment (if at all), but if it works you would be able to drag & drop the sketch and constrain it to the hole diameter.

www.nxjournaling.com
 
Cowski Thanks very much for saying this option.

But i am experiencing same problem at here also (i can't able to control the size of 2d reusable sketch. please see attached image for details)

please suggest a way


Thanks
 
 http://files.engineering.com/getfile.aspx?folder=30b06d7d-23cd-4b93-859b-37225107666b&file=Reusable_Object.jpg
I have found a solution for this. I just created two lines and two arcs using basic curve on a circle and used cross hatch to get it filled (See attached image). this type of symbol is parametric with hole but this process takes much time than adjusting a custom dowel symbol. so i have recorded a journal file while doing this task (See below)

Code:
Option Strict Off
Imports System
Imports NXOpen

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work

Dim displayPart As Part = theSession.Parts.Display

' ----------------------------------------------
'   Menu: Insert->Curve->Line...
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

Dim nullFeatures_AssociativeLine As Features.AssociativeLine = Nothing


If Not workPart.Preferences.Modeling.GetHistoryMode Then
    Throw(New Exception("Create or edit of a Feature was recorded in History Mode but playback is in History-Free Mode."))
End If

Dim associativeLineBuilder1 As Features.AssociativeLineBuilder
associativeLineBuilder1 = workPart.BaseFeatures.CreateAssociativeLineBuilder(nullFeatures_AssociativeLine)

Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
Dim normal1 As Vector3d = New Vector3d(0.0, 0.0, 1.0)
Dim plane1 As Plane
plane1 = workPart.Planes.CreatePlane(origin1, normal1, SmartObject.UpdateOption.WithinModeling)

Dim section1 As Section
section1 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim unit1 As Unit
unit1 = associativeLineBuilder1.Limits.StartLimit.Distance.Units

Dim expression1 As Expression
expression1 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

Dim section2 As Section
section2 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression2 As Expression
expression2 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

associativeLineBuilder1.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder1.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Point

associativeLineBuilder1.StartAngle.RightHandSide = "0"

associativeLineBuilder1.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Point

associativeLineBuilder1.Angle.RightHandSide = "275"

associativeLineBuilder1.Limits.StartLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeLineBuilder1.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder1.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeLineBuilder1.Limits.EndLimit.Distance.RightHandSide = "50"

associativeLineBuilder1.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Inferred

associativeLineBuilder1.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Inferred

associativeLineBuilder1.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder1.Limits.EndLimit.Distance.RightHandSide = "0"

theSession.SetUndoMarkName(markId1, "Line Dialog")

Dim scalar1 As Scalar
scalar1 = workPart.Scalars.CreateScalar(0.5, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)

[highlight #FCE94F]Dim bodyFeature1 As Features.BodyFeature = CType(workPart.Features.FindObject("SIMPLE HOLE(2:1A)"), Features.BodyFeature)[/highlight] 'selected circle edge

Dim edge1 As Edge = CType(bodyFeature1.FindObject("EDGE * 3 EXTRUDE(1) 130 {(10.8253175473055,-20,1.25)(0,-20,-17.5)(-10.8253175473055,-20,1.25) EXTRUDE(1)}"), Edge)

Dim point1 As Point
point1 = workPart.Points.CreatePoint(edge1, scalar1, SmartObject.UpdateOption.AfterModeling)

[highlight #FCE94F]Dim baseView1 As Drawings.BaseView = CType(workPart.DraftingViews.FindObject("FRONT@2"), Drawings.BaseView)[/highlight] 'selected view

Dim xform1 As Xform
xform1 = workPart.Xforms.CreateXformWithView(baseView1, SmartObject.UpdateOption.AfterModeling)

Dim point2 As Point
point2 = workPart.Points.CreatePoint(point1, xform1, SmartObject.UpdateOption.AfterModeling)

associativeLineBuilder1.StartPoint.Value = point2

associativeLineBuilder1.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Point

Dim scalar2 As Scalar
scalar2 = workPart.Scalars.CreateScalar(0.0, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)

Dim point3 As Point
point3 = workPart.Points.CreatePoint(edge1, scalar2, SmartObject.UpdateOption.AfterModeling)

Dim xform2 As Xform
xform2 = workPart.Xforms.CreateXformWithView(baseView1, SmartObject.UpdateOption.AfterModeling)

Dim point4 As Point
point4 = workPart.Points.CreatePoint(point3, xform2, SmartObject.UpdateOption.AfterModeling)

associativeLineBuilder1.Limits.EndLimit.Distance.RightHandSide = "50"

associativeLineBuilder1.EndPoint.Value = point4

associativeLineBuilder1.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Point

Dim markId2 As Session.UndoMarkId
markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Line")

Dim nXObject1 As NXObject
nXObject1 = associativeLineBuilder1.Commit()

theSession.DeleteUndoMark(markId2, Nothing)

theSession.SetUndoMarkName(markId1, "Line")

associativeLineBuilder1.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression2)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section2.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression1)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section1.Destroy()

plane1.DestroyPlane()

Dim markId3 As Session.UndoMarkId
markId3 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

Dim associativeLineBuilder2 As Features.AssociativeLineBuilder
associativeLineBuilder2 = workPart.BaseFeatures.CreateAssociativeLineBuilder(nullFeatures_AssociativeLine)

Dim origin2 As Point3d = New Point3d(0.0, 0.0, 0.0)
Dim normal2 As Vector3d = New Vector3d(0.0, 0.0, 1.0)
Dim plane2 As Plane
plane2 = workPart.Planes.CreatePlane(origin2, normal2, SmartObject.UpdateOption.WithinModeling)

Dim section3 As Section
section3 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression3 As Expression
expression3 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

Dim section4 As Section
section4 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression4 As Expression
expression4 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

associativeLineBuilder2.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder2.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Point

associativeLineBuilder2.StartAngle.RightHandSide = "0"

associativeLineBuilder2.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Point

associativeLineBuilder2.Angle.RightHandSide = "275"

associativeLineBuilder2.Limits.StartLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeLineBuilder2.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder2.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeLineBuilder2.Limits.EndLimit.Distance.RightHandSide = "50"

associativeLineBuilder2.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Inferred

associativeLineBuilder2.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Inferred

associativeLineBuilder2.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder2.Limits.EndLimit.Distance.RightHandSide = "0"

theSession.SetUndoMarkName(markId3, "Line Dialog")

' ----------------------------------------------
'   Dialog Begin Line
' ----------------------------------------------
Dim scalar3 As Scalar
scalar3 = workPart.Scalars.CreateScalar(0.75000000000049, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)

Dim point5 As Point
point5 = workPart.Points.CreatePoint(edge1, scalar3, SmartObject.UpdateOption.AfterModeling)

Dim xform3 As Xform
xform3 = workPart.Xforms.CreateXformWithView(baseView1, SmartObject.UpdateOption.AfterModeling)

Dim point6 As Point
point6 = workPart.Points.CreatePoint(point5, xform3, SmartObject.UpdateOption.AfterModeling)

associativeLineBuilder2.StartPoint.Value = point6

associativeLineBuilder2.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Point

Dim scalar4 As Scalar
scalar4 = workPart.Scalars.CreateScalar(0.24999999999951, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)

Dim point7 As Point
point7 = workPart.Points.CreatePoint(edge1, scalar4, SmartObject.UpdateOption.AfterModeling)

Dim xform4 As Xform
xform4 = workPart.Xforms.CreateXformWithView(baseView1, SmartObject.UpdateOption.AfterModeling)

Dim point8 As Point
point8 = workPart.Points.CreatePoint(point7, xform4, SmartObject.UpdateOption.AfterModeling)

associativeLineBuilder2.Limits.EndLimit.Distance.RightHandSide = "50"

associativeLineBuilder2.EndPoint.Value = point8

associativeLineBuilder2.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Point

Dim markId4 As Session.UndoMarkId
markId4 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Line")

Dim nXObject2 As NXObject
nXObject2 = associativeLineBuilder2.Commit()

theSession.DeleteUndoMark(markId4, Nothing)

theSession.SetUndoMarkName(markId3, "Line")

associativeLineBuilder2.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression4)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section4.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression3)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section3.Destroy()

plane2.DestroyPlane()

Dim markId5 As Session.UndoMarkId
markId5 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

Dim associativeLineBuilder3 As Features.AssociativeLineBuilder
associativeLineBuilder3 = workPart.BaseFeatures.CreateAssociativeLineBuilder(nullFeatures_AssociativeLine)

Dim origin3 As Point3d = New Point3d(0.0, 0.0, 0.0)
Dim normal3 As Vector3d = New Vector3d(0.0, 0.0, 1.0)
Dim plane3 As Plane
plane3 = workPart.Planes.CreatePlane(origin3, normal3, SmartObject.UpdateOption.WithinModeling)

Dim section5 As Section
section5 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression5 As Expression
expression5 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

Dim section6 As Section
section6 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression6 As Expression
expression6 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

associativeLineBuilder3.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder3.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Point

associativeLineBuilder3.StartAngle.RightHandSide = "0"

associativeLineBuilder3.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Point

associativeLineBuilder3.Angle.RightHandSide = "275"

associativeLineBuilder3.Limits.StartLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeLineBuilder3.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder3.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeLineBuilder3.Limits.EndLimit.Distance.RightHandSide = "50"

associativeLineBuilder3.StartPointOptions = Features.AssociativeLineBuilder.StartOption.Inferred

associativeLineBuilder3.EndPointOptions = Features.AssociativeLineBuilder.EndOption.Inferred

associativeLineBuilder3.Limits.StartLimit.Distance.RightHandSide = "0"

associativeLineBuilder3.Limits.EndLimit.Distance.RightHandSide = "0"

theSession.SetUndoMarkName(markId5, "Line Dialog")

' ----------------------------------------------
'   Dialog Begin Line
' ----------------------------------------------
' ----------------------------------------------
'   Menu: Insert->Curve->Arc/Circle...
' ----------------------------------------------
associativeLineBuilder3.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression6)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section6.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression5)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section5.Destroy()

plane3.DestroyPlane()

theSession.UndoToMark(markId5, Nothing)

theSession.DeleteUndoMark(markId5, Nothing)

Dim markId6 As Session.UndoMarkId
markId6 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

Dim nullFeatures_AssociativeArc As Features.AssociativeArc = Nothing

Dim associativeArcBuilder1 As Features.AssociativeArcBuilder
associativeArcBuilder1 = workPart.BaseFeatures.CreateAssociativeArcBuilder(nullFeatures_AssociativeArc)

Dim origin4 As Point3d = New Point3d(0.0, 0.0, 0.0)
Dim normal4 As Vector3d = New Vector3d(0.0, 0.0, 1.0)
Dim plane4 As Plane
plane4 = workPart.Planes.CreatePlane(origin4, normal4, SmartObject.UpdateOption.WithinModeling)

Dim section7 As Section
section7 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression7 As Expression
expression7 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

Dim section8 As Section
section8 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression8 As Expression
expression8 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

associativeArcBuilder1.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder1.Type = Features.AssociativeArcBuilder.Types.ArcFromCenter

associativeArcBuilder1.EndPointOptions = Features.AssociativeArcBuilder.EndOption.Point

associativeArcBuilder1.Radius.RightHandSide = "25"

associativeArcBuilder1.Diameter.RightHandSide = "50"

associativeArcBuilder1.Limits.StartLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeArcBuilder1.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder1.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.Value

associativeArcBuilder1.Limits.EndLimit.Distance.RightHandSide = "90"

associativeArcBuilder1.EndPointOptions = Features.AssociativeArcBuilder.EndOption.Inferred

associativeArcBuilder1.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder1.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeArcBuilder1.Limits.EndLimit.Distance.RightHandSide = "0"

associativeArcBuilder1.Radius.RightHandSide = "0"

associativeArcBuilder1.Diameter.RightHandSide = "0"

theSession.SetUndoMarkName(markId6, "Arc/Circle Dialog")

associativeArcBuilder1.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.Value

associativeArcBuilder1.Limits.EndLimit.Distance.RightHandSide = "45"

Dim scalar5 As Scalar
scalar5 = workPart.Scalars.CreateScalar(0.5, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)

Dim line1 As Line = CType(workPart.Lines.FindObject("ENTITY 3 1 1"), Line)

Dim point9 As Point
point9 = workPart.Points.CreatePoint(line1, scalar5, SmartObject.UpdateOption.AfterModeling)

associativeArcBuilder1.CenterPoint.Value = point9

associativeArcBuilder1.Radius.RightHandSide = "1"

associativeArcBuilder1.Diameter.RightHandSide = "2"

associativeArcBuilder1.Radius.RightHandSide = "0"

associativeArcBuilder1.Diameter.RightHandSide = "0"

associativeArcBuilder1.Radius.RightHandSide = "1"

associativeArcBuilder1.Diameter.RightHandSide = "2"

associativeArcBuilder1.Radius.RightHandSide = "3"

associativeArcBuilder1.Diameter.RightHandSide = "6"

associativeArcBuilder1.Radius.RightHandSide = "5"

associativeArcBuilder1.Diameter.RightHandSide = "10"

associativeArcBuilder1.Radius.RightHandSide = "7"

associativeArcBuilder1.Diameter.RightHandSide = "14"

associativeArcBuilder1.Radius.RightHandSide = "9"

associativeArcBuilder1.Diameter.RightHandSide = "18"

associativeArcBuilder1.Radius.RightHandSide = "10"

associativeArcBuilder1.Diameter.RightHandSide = "20"

associativeArcBuilder1.Radius.RightHandSide = "11"

associativeArcBuilder1.Diameter.RightHandSide = "22"

associativeArcBuilder1.Radius.RightHandSide = "12"

associativeArcBuilder1.Diameter.RightHandSide = "24"

associativeArcBuilder1.Radius.RightHandSide = "13"

associativeArcBuilder1.Diameter.RightHandSide = "26"

associativeArcBuilder1.Radius.RightHandSide = "14"

associativeArcBuilder1.Diameter.RightHandSide = "28"

associativeArcBuilder1.Radius.RightHandSide = "15"

associativeArcBuilder1.Diameter.RightHandSide = "30"

associativeArcBuilder1.Radius.RightHandSide = "16"

associativeArcBuilder1.Diameter.RightHandSide = "32"

associativeArcBuilder1.Radius.RightHandSide = "17"

associativeArcBuilder1.Diameter.RightHandSide = "34"

associativeArcBuilder1.Radius.RightHandSide = "18"

associativeArcBuilder1.Diameter.RightHandSide = "36"

associativeArcBuilder1.Radius.RightHandSide = "19"

associativeArcBuilder1.Diameter.RightHandSide = "38"

associativeArcBuilder1.Radius.RightHandSide = "20"

associativeArcBuilder1.Diameter.RightHandSide = "40"

associativeArcBuilder1.Radius.RightHandSide = "21"

associativeArcBuilder1.Diameter.RightHandSide = "42"

associativeArcBuilder1.Radius.RightHandSide = "20"

associativeArcBuilder1.Diameter.RightHandSide = "40"

associativeArcBuilder1.Radius.RightHandSide = "19"

associativeArcBuilder1.Diameter.RightHandSide = "38"

associativeArcBuilder1.Radius.RightHandSide = "17"

associativeArcBuilder1.Diameter.RightHandSide = "34"

associativeArcBuilder1.Radius.RightHandSide = "13"

associativeArcBuilder1.Diameter.RightHandSide = "26"

associativeArcBuilder1.Radius.RightHandSide = "11"

associativeArcBuilder1.Diameter.RightHandSide = "22"

associativeArcBuilder1.Radius.RightHandSide = "10"

associativeArcBuilder1.Diameter.RightHandSide = "20"

associativeArcBuilder1.Radius.RightHandSide = "11"

associativeArcBuilder1.Diameter.RightHandSide = "22"

associativeArcBuilder1.Radius.RightHandSide = "12"

associativeArcBuilder1.Diameter.RightHandSide = "24"

associativeArcBuilder1.Radius.RightHandSide = "13"

associativeArcBuilder1.Diameter.RightHandSide = "26"

associativeArcBuilder1.Radius.RightHandSide = "14"

associativeArcBuilder1.Diameter.RightHandSide = "28"

associativeArcBuilder1.Radius.RightHandSide = "15"

associativeArcBuilder1.Diameter.RightHandSide = "30"

associativeArcBuilder1.Radius.RightHandSide = "16"

associativeArcBuilder1.Diameter.RightHandSide = "32"

associativeArcBuilder1.Radius.RightHandSide = "17"

associativeArcBuilder1.Diameter.RightHandSide = "34"

associativeArcBuilder1.Radius.RightHandSide = "18"

associativeArcBuilder1.Diameter.RightHandSide = "36"

associativeArcBuilder1.Radius.RightHandSide = "19"

associativeArcBuilder1.Diameter.RightHandSide = "38"

associativeArcBuilder1.Radius.RightHandSide = "20"

associativeArcBuilder1.Diameter.RightHandSide = "40"

associativeArcBuilder1.Radius.RightHandSide = "21"

associativeArcBuilder1.Diameter.RightHandSide = "42"

associativeArcBuilder1.Radius.RightHandSide = "22"

associativeArcBuilder1.Diameter.RightHandSide = "44"

associativeArcBuilder1.Radius.RightHandSide = "23"

associativeArcBuilder1.Diameter.RightHandSide = "46"

associativeArcBuilder1.Radius.RightHandSide = "23.1295396123217"

associativeArcBuilder1.Diameter.RightHandSide = "46.2590792246435"

associativeArcBuilder1.Radius.RightHandSide = "23.1295"

associativeArcBuilder1.Diameter.RightHandSide = "46.259"

associativeArcBuilder1.Radius.RightHandSide = "23"

associativeArcBuilder1.Diameter.RightHandSide = "46"

associativeArcBuilder1.Radius.RightHandSide = "419.343038874843"

associativeArcBuilder1.Diameter.RightHandSide = "838.686077749686"

associativeArcBuilder1.Radius.RightHandSide = "419.343"

associativeArcBuilder1.Diameter.RightHandSide = "838.686"

associativeArcBuilder1.Radius.RightHandSide = "24"

associativeArcBuilder1.Diameter.RightHandSide = "48"

associativeArcBuilder1.Radius.RightHandSide = "419.343038874843"

associativeArcBuilder1.Diameter.RightHandSide = "838.686077749686"

associativeArcBuilder1.Radius.RightHandSide = "419.343"

associativeArcBuilder1.Diameter.RightHandSide = "838.686"

associativeArcBuilder1.Radius.RightHandSide = "24"

associativeArcBuilder1.Diameter.RightHandSide = "48"

associativeArcBuilder1.Radius.RightHandSide = "419.343038874843"

associativeArcBuilder1.Diameter.RightHandSide = "838.686077749686"

associativeArcBuilder1.Radius.RightHandSide = "419.343"

associativeArcBuilder1.Diameter.RightHandSide = "838.686"

associativeArcBuilder1.Radius.RightHandSide = "24"

associativeArcBuilder1.Diameter.RightHandSide = "48"

associativeArcBuilder1.Radius.RightHandSide = "419.343038874843"

associativeArcBuilder1.Diameter.RightHandSide = "838.686077749686"

associativeArcBuilder1.Radius.RightHandSide = "419.343"

associativeArcBuilder1.Diameter.RightHandSide = "838.686"

associativeArcBuilder1.Radius.RightHandSide = "24"

associativeArcBuilder1.Diameter.RightHandSide = "48"

associativeArcBuilder1.Radius.RightHandSide = "419.343038874843"

associativeArcBuilder1.Diameter.RightHandSide = "838.686077749686"

associativeArcBuilder1.Radius.RightHandSide = "419.343"

associativeArcBuilder1.Diameter.RightHandSide = "838.686"

Dim scalar6 As Scalar
scalar6 = workPart.Scalars.CreateScalar(0.0, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)

Dim line2 As Line = CType(workPart.Lines.FindObject("ENTITY 3 2 1"), Line)

Dim point10 As Point
point10 = workPart.Points.CreatePoint(line2, scalar6, SmartObject.UpdateOption.AfterModeling)

associativeArcBuilder1.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder1.EndPoint.Value = point10

associativeArcBuilder1.EndPointOptions = Features.AssociativeArcBuilder.EndOption.Point

associativeArcBuilder1.Radius.RightHandSide = "25"

associativeArcBuilder1.Diameter.RightHandSide = "50"

associativeArcBuilder1.Limits.EndLimit.Distance.RightHandSide = "90"

Dim markId7 As Session.UndoMarkId
markId7 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Arc/Circle")

Dim zonepoint1 As Point3d = New Point3d(206.34873909176, 189.302033524064, 0.0)
associativeArcBuilder1.ZonePoint = zonepoint1

Dim nXObject3 As NXObject
nXObject3 = associativeArcBuilder1.Commit()

theSession.DeleteUndoMark(markId7, Nothing)

theSession.SetUndoMarkName(markId6, "Arc/Circle")

Dim expression9 As Expression = associativeArcBuilder1.Limits.EndLimit.Distance

associativeArcBuilder1.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression8)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section8.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression7)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section7.Destroy()

plane4.DestroyPlane()

Dim markId8 As Session.UndoMarkId
markId8 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

Dim associativeArcBuilder2 As Features.AssociativeArcBuilder
associativeArcBuilder2 = workPart.BaseFeatures.CreateAssociativeArcBuilder(nullFeatures_AssociativeArc)

Dim origin5 As Point3d = New Point3d(0.0, 0.0, 0.0)
Dim normal5 As Vector3d = New Vector3d(0.0, 0.0, 1.0)
Dim plane5 As Plane
plane5 = workPart.Planes.CreatePlane(origin5, normal5, SmartObject.UpdateOption.WithinModeling)

Dim section9 As Section
section9 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression10 As Expression
expression10 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

Dim section10 As Section
section10 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

Dim expression11 As Expression
expression11 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)

associativeArcBuilder2.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder2.Type = Features.AssociativeArcBuilder.Types.ArcFromCenter

associativeArcBuilder2.EndPointOptions = Features.AssociativeArcBuilder.EndOption.Point

associativeArcBuilder2.Radius.RightHandSide = "25"

associativeArcBuilder2.Diameter.RightHandSide = "50"

associativeArcBuilder2.Limits.StartLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeArcBuilder2.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder2.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.Value

associativeArcBuilder2.Limits.EndLimit.Distance.RightHandSide = "90"

associativeArcBuilder2.EndPointOptions = Features.AssociativeArcBuilder.EndOption.Inferred

associativeArcBuilder2.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder2.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.AtPoint

associativeArcBuilder2.Limits.EndLimit.Distance.RightHandSide = "0"

associativeArcBuilder2.Radius.RightHandSide = "0"

associativeArcBuilder2.Diameter.RightHandSide = "0"

theSession.SetUndoMarkName(markId8, "Arc/Circle Dialog")

associativeArcBuilder2.Limits.EndLimit.LimitOption = GeometricUtilities.CurveExtendData.LimitOptions.Value

associativeArcBuilder2.Limits.EndLimit.Distance.RightHandSide = "45"

' ----------------------------------------------
'   Dialog Begin Arc/Circle
' ----------------------------------------------
Dim arc1 As Arc = CType(workPart.Arcs.FindObject("ENTITY 5 1 1"), Arc)

Dim point11 As Point
point11 = workPart.Points.CreatePoint(arc1, SmartObject.UpdateOption.AfterModeling)

associativeArcBuilder2.CenterPoint.Value = point11

associativeArcBuilder2.Radius.RightHandSide = "1"

associativeArcBuilder2.Diameter.RightHandSide = "2"

associativeArcBuilder2.Radius.RightHandSide = "2"

associativeArcBuilder2.Diameter.RightHandSide = "4"

associativeArcBuilder2.Radius.RightHandSide = "3"

associativeArcBuilder2.Diameter.RightHandSide = "6"

associativeArcBuilder2.Radius.RightHandSide = "4"

associativeArcBuilder2.Diameter.RightHandSide = "8"

associativeArcBuilder2.Radius.RightHandSide = "5"

associativeArcBuilder2.Diameter.RightHandSide = "10"

associativeArcBuilder2.Radius.RightHandSide = "6"

associativeArcBuilder2.Diameter.RightHandSide = "12"

associativeArcBuilder2.Radius.RightHandSide = "7"

associativeArcBuilder2.Diameter.RightHandSide = "14"

associativeArcBuilder2.Radius.RightHandSide = "8"

associativeArcBuilder2.Diameter.RightHandSide = "16"

associativeArcBuilder2.Radius.RightHandSide = "9"

associativeArcBuilder2.Diameter.RightHandSide = "18"

associativeArcBuilder2.Radius.RightHandSide = "10"

associativeArcBuilder2.Diameter.RightHandSide = "20"

associativeArcBuilder2.Radius.RightHandSide = "12"

associativeArcBuilder2.Diameter.RightHandSide = "24"

associativeArcBuilder2.Radius.RightHandSide = "13"

associativeArcBuilder2.Diameter.RightHandSide = "26"

associativeArcBuilder2.Radius.RightHandSide = "14"

associativeArcBuilder2.Diameter.RightHandSide = "28"

associativeArcBuilder2.Radius.RightHandSide = "15"

associativeArcBuilder2.Diameter.RightHandSide = "30"

associativeArcBuilder2.Radius.RightHandSide = "16"

associativeArcBuilder2.Diameter.RightHandSide = "32"

associativeArcBuilder2.Radius.RightHandSide = "17"

associativeArcBuilder2.Diameter.RightHandSide = "34"

associativeArcBuilder2.Radius.RightHandSide = "18"

associativeArcBuilder2.Diameter.RightHandSide = "36"

associativeArcBuilder2.Radius.RightHandSide = "19"

associativeArcBuilder2.Diameter.RightHandSide = "38"

associativeArcBuilder2.Radius.RightHandSide = "20"

associativeArcBuilder2.Diameter.RightHandSide = "40"

associativeArcBuilder2.Radius.RightHandSide = "21"

associativeArcBuilder2.Diameter.RightHandSide = "42"

associativeArcBuilder2.Radius.RightHandSide = "20.6082563060456"

associativeArcBuilder2.Diameter.RightHandSide = "41.2165126120912"

associativeArcBuilder2.Radius.RightHandSide = "20.6083"

associativeArcBuilder2.Diameter.RightHandSide = "41.2166"

associativeArcBuilder2.Radius.RightHandSide = "20.7673028366578"

associativeArcBuilder2.Diameter.RightHandSide = "41.5346056733157"

associativeArcBuilder2.Radius.RightHandSide = "20.7673"

associativeArcBuilder2.Diameter.RightHandSide = "41.5346"

associativeArcBuilder2.Radius.RightHandSide = "21.4034889591068"

associativeArcBuilder2.Diameter.RightHandSide = "42.8069779182136"

associativeArcBuilder2.Radius.RightHandSide = "21.4035"

associativeArcBuilder2.Diameter.RightHandSide = "42.807"

associativeArcBuilder2.Radius.RightHandSide = "22.0396750815558"

associativeArcBuilder2.Diameter.RightHandSide = "44.0793501631117"

associativeArcBuilder2.Radius.RightHandSide = "22.0397"

associativeArcBuilder2.Diameter.RightHandSide = "44.0794"

associativeArcBuilder2.Radius.RightHandSide = "22.834907734617"

associativeArcBuilder2.Diameter.RightHandSide = "45.6698154692341"

associativeArcBuilder2.Radius.RightHandSide = "22.8349"

associativeArcBuilder2.Diameter.RightHandSide = "45.6698"

associativeArcBuilder2.Radius.RightHandSide = "23"

associativeArcBuilder2.Diameter.RightHandSide = "46"

associativeArcBuilder2.Radius.RightHandSide = "24"

associativeArcBuilder2.Diameter.RightHandSide = "48"

associativeArcBuilder2.Radius.RightHandSide = "24.9999999999231"

associativeArcBuilder2.Diameter.RightHandSide = "49.9999999998462"

associativeArcBuilder2.Radius.RightHandSide = "24"

associativeArcBuilder2.Diameter.RightHandSide = "48"

associativeArcBuilder2.Radius.RightHandSide = "419.343038874843"

associativeArcBuilder2.Diameter.RightHandSide = "838.686077749686"

associativeArcBuilder2.Radius.RightHandSide = "419.343"

associativeArcBuilder2.Diameter.RightHandSide = "838.686"

associativeArcBuilder2.Radius.RightHandSide = "24"

associativeArcBuilder2.Diameter.RightHandSide = "48"

associativeArcBuilder2.Radius.RightHandSide = "419.343038874843"

associativeArcBuilder2.Diameter.RightHandSide = "838.686077749686"

associativeArcBuilder2.Radius.RightHandSide = "419.343"

associativeArcBuilder2.Diameter.RightHandSide = "838.686"

Dim scalar7 As Scalar
scalar7 = workPart.Scalars.CreateScalar(1.0, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)

Dim point12 As Point
point12 = workPart.Points.CreatePoint(line2, scalar7, SmartObject.UpdateOption.AfterModeling)

associativeArcBuilder2.Limits.StartLimit.Distance.RightHandSide = "0"

associativeArcBuilder2.EndPoint.Value = point12

associativeArcBuilder2.EndPointOptions = Features.AssociativeArcBuilder.EndOption.Point

associativeArcBuilder2.Radius.RightHandSide = "25"

associativeArcBuilder2.Diameter.RightHandSide = "50"

associativeArcBuilder2.Limits.EndLimit.Distance.RightHandSide = "90"

Dim markId9 As Session.UndoMarkId
markId9 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Arc/Circle")

Dim zonepoint2 As Point3d = New Point3d(212.875048702762, 139.729790455374, 0.0)
associativeArcBuilder2.ZonePoint = zonepoint2

Dim nXObject4 As NXObject
nXObject4 = associativeArcBuilder2.Commit()

theSession.DeleteUndoMark(markId9, Nothing)

theSession.SetUndoMarkName(markId8, "Arc/Circle")

Dim expression12 As Expression = associativeArcBuilder2.Limits.EndLimit.Distance

associativeArcBuilder2.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression11)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section10.Destroy()

Try
  ' Expression is still in use.
  workPart.Expressions.Delete(expression10)
Catch ex As NXException
  ex.AssertErrorCode(1050029)
End Try

section9.Destroy()

plane5.DestroyPlane()

' ----------------------------------------------
'   Menu: Insert->Annotation->Crosshatch...
' ----------------------------------------------
Dim markId10 As Session.UndoMarkId
markId10 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

Dim nullAnnotations_Hatch As Annotations.Hatch = Nothing

Dim hatchBuilder1 As Annotations.HatchBuilder
hatchBuilder1 = workPart.Annotations.Hatches.CreateHatchBuilder(nullAnnotations_Hatch)

hatchBuilder1.AnnotationType = Annotations.HatchBuilder.AnnotationTypes.Crosshatch

hatchBuilder1.Boundary.SelectionType = Annotations.BoundaryBuilder.SelectionMethod.Curves

        hatchBuilder1.HatchFillSettings.CrosshatchFile = "C:\Program Files\UGS\NX 7.5\UGII\xhatch.chx"

hatchBuilder1.HatchFillSettings.Distance = 0.2

hatchBuilder1.HatchFillSettings.Angle = 44.9999999999988

hatchBuilder1.HatchFillSettings.Color = workPart.Colors.Find("Pale Pink")

hatchBuilder1.HatchFillSettings.Tolerance = 0.1

theSession.SetUndoMarkName(markId10, "Crosshatch Dialog")

Dim section11 As Section
section11 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5)

hatchBuilder1.Boundary.CurveBoundaries.Append(section11)

section11.SetAllowedEntityTypes(Section.AllowTypes.OnlyCurves)

section11.SetInterpart(False)

Dim markId11 As Session.UndoMarkId
markId11 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "section mark")

Dim markId12 As Session.UndoMarkId
markId12 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, Nothing)

Dim curves1(3) As Curve
Dim arc2 As Arc = CType(workPart.Arcs.FindObject("ENTITY 5 1 1"), Arc)

curves1(0) = arc2
curves1(1) = line2
curves1(2) = arc1
curves1(3) = line1
Dim curveDumbRule1 As CurveDumbRule
curveDumbRule1 = workPart.ScRuleFactory.CreateRuleCurveDumb(curves1)

section11.AllowSelfIntersection(True)

Dim rules1(0) As SelectionIntentRule
rules1(0) = curveDumbRule1
Dim nullNXObject As NXObject = Nothing

Dim helpPoint1 As Point3d = New Point3d(230.623288815784, 150.981409110694, 0.0)
section11.AddToSection(rules1, arc2, nullNXObject, nullNXObject, helpPoint1, Section.Mode.Create, False)

theSession.DeleteUndoMark(markId12, Nothing)

hatchBuilder1.Boundary.SetView(workPart.Views.WorkView)

theSession.DeleteUndoMark(markId11, Nothing)

Dim markId13 As Session.UndoMarkId
markId13 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Crosshatch")

Dim nXObject5 As NXObject
nXObject5 = hatchBuilder1.Commit()

theSession.DeleteUndoMark(markId13, Nothing)

theSession.SetUndoMarkName(markId10, "Crosshatch")

hatchBuilder1.Destroy()

' ----------------------------------------------
'   Menu: Tools->Journal->Stop Recording
' ----------------------------------------------

End Sub
End Module

now i want to use this code for all circles but circle id and view id are hard coded in the journal so journal gives an error when a hole id/view id changes. please suggest a way to create a journal that prompts user to select a circle and get id's automatically and loop this program until user chooses cancel.

Thanks
Ram
 
 http://files.engineering.com/getfile.aspx?folder=6bddf471-5042-499d-9267-c094fe818a15&file=Associate_Dowel_Symbol.jpg
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top