Continue to Site

Welcome to 3DCADForums

Join our CAD community forums where over 25,000 users interact to solve day to day problems and share ideas. We encourage you to visit, invite you to participate and look forward to your input and opinions. Acrobat 3D, AutoCAD, Catia, Inventor, IronCAD, Creo, Pro/ENGINEER, Solid Edge, SolidWorks, and others.

Delete Selected Items Macro

J

jacklavender

Guest
Hi,

I want to write a macro that will draw a selection box and then delete whatever is selected there. (Its for modifying some old drawings that have unwanted notes on them in the same location each time.)

Hope you can help!

Jack

this is what I have...

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("Sheet1", "SHEET", 0.1899620074174, 0.1867665172791, 0, False, 0, Nothing, 0)

' Here I want to delete whatever is selected rather than a named item
boolstatus = Part.Extension.SelectByID2("DetailItem1968@Sheet1", "NOTE", 0, 0, 0, True, 0, Nothing, 0)
Part.EditDelete
End Sub
 

Articles From 3DCAD World

Sponsor

Back
Top