Nilesh, thanx for your reply.But I have already read that, it's not helpful.
I just tried and it works for me, can you run this
Inserts center marks for each view in active sheet
Change "AutoInsertCenterMarks" function options as you wish
Dim swApp SldWorks.Sldworks
Set swApp = Application.SldWorks
Dim swmodel As Sldworks.ModelDoc2
Dim swdraw As SldWorks.DrawingDoc
Dim sh As Sldworks.Sheet
Dim viv As SldWorks.View
Dim boolstat As Boolean
Set swmodel = swApp.ActiveDoc
Set swdraw = swmodel
Set sh = swdraw.GetCurrentSheet
For Each vi In sh.GetViews
Set viv = vi
boolstat = swdraw.ActivateView(viv.Name)
boolstat = viv.AutoInsertCenterMarks(swAutoInsertCenterMarkType_Hole, swCenterMark_ShowBaseCenterMarkLines, True, True, True, 0.0025, True, True, 0)
it seems like nobody needs this macro...
I don't know if it is possible but here might be some helpful sudo code:
user selects the primary center point edge on the drawing
use the api to get the edge
loop over all circular edges in the view
create a unique linear center mark group between each circular edge and the center point edge using
InsertCenterMark3 and swCenterMark_LinearGroup
i think you could then hide the connecting lines by turning off swCenterMark_ShowLinearConnectLines
I appreciate your reply, but I totally have no idea how to start this code.
I will keep looking for the solution, thanks again.
I threw a quick macro together that will hopefully get you started. You'll need to pick the view that you want to place the center marks on before you run it. Also, it's got some limitations - like using the first component it finds in the view to place the center marks on, so you'll probably have to tweak it for your particular requirements. Either way, I hope it helps you get going.
DoCircularCenterMarks.swp.zip 10.8 KB