Get a centerpoint on the centermark, when projection a circular geometry

Get a centerpoint on the centermark, when projection a circular geometry

cco2JFB7
Participant Participant
252 Views
2 Replies
Message 1 of 3

Get a centerpoint on the centermark, when projection a circular geometry

cco2JFB7
Participant
Participant

Do any have an idea of a rule that will put a center point on the center mark, when projection of a circular geometry?

I have looked for a snippet but without any luck

 

Thanks

Christian

0 Likes
253 Views
2 Replies
Replies (2)
Message 2 of 3

A.Acheson
Mentor
Mentor

Hi @cco2JFB7 

I don't have a sample at hand but this sample here might give you some help.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 3

A.Acheson
Mentor
Mentor

Hi @cco2JFB7 

 

Here is a sample

AAcheson_0-1689458146429.png

 

  	Dim oPartDoc As PartDocument = ThisDoc.Document
                    
	'  Reference to the component definition.
	Dim compDef As PartComponentDefinition = oPartDoc.ComponentDefinition
	
	' Get the sketch we want to use.
	Dim sketch As PlanarSketch = compDef.Sketches(2)

	sketch.edit

	' Prompt user to select an edge.
	Dim cirEdge As Edge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Select an edge")

	' Add the circles edge to the sketch by projecting.
	Dim sketchCirc As SketchCircle = sketch.AddByProjectingEntity(cirEdge)

	' Get centerpoint as SketchPoint.
	Dim cirSketchPoint As SketchPoint = sketchCirc.CenterSketchPoint
	
	' Convert the Sketchpoint to Hole Center.
	cirSketchPoint.HoleCenter = True

 	sketch.ExitEdit

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes