Axis lines when creating a new sketch
Axis lines when creating a new sketch
Hello,
First, sorry for my English, not my 1st language.. doing my best.
I tried to find an answer to what I'm looking for but can't find anything.
So I'm kinda new to Solidworks, have been a long time Catia user but my new job uses Solidworks, I love it !
One thing I miss is how to have X and Y axis directly when I create a new sketch. Of course the origin is always there but 99% of the time I start by creating 2 axis in my new sketch. Then I take care of the dimensions from those 2 construction lines.
Is there any way to have those 2 lines already there when I create a new sketch ?
I attached a picture of what I'm looking for...
Thanks for any help !
First, sorry for my English, not my 1st language.. doing my best.
I tried to find an answer to what I'm looking for but can't find anything.
So I'm kinda new to Solidworks, have been a long time Catia user but my new job uses Solidworks, I love it !
One thing I miss is how to have X and Y axis directly when I create a new sketch. Of course the origin is always there but 99% of the time I start by creating 2 axis in my new sketch. Then I take care of the dimensions from those 2 construction lines.
Is there any way to have those 2 lines already there when I create a new sketch ?
I attached a picture of what I'm looking for...
Thanks for any help !
Re: Axis lines when creating a new sketch
You have two options....
Option 1: Create a sketch with the two lines in it and save it as a Library file. This sketch can then be dragged into any new Part file and you're off to the races. Keep in mind that you can bring it in and leave it referencing the original or can break the link so that way it's not looking at the original sketch.
Option 2: Create the sketch and then do "File, Save As" and then change it to a "Part Template". This will then make it so that when you open anew Part file and use that template the sketch will always be there.
The second method might be preferred... and just know that just about anything can be saved into a Part, Assembly, or Drawing template.
Option 1: Create a sketch with the two lines in it and save it as a Library file. This sketch can then be dragged into any new Part file and you're off to the races. Keep in mind that you can bring it in and leave it referencing the original or can break the link so that way it's not looking at the original sketch.
Option 2: Create the sketch and then do "File, Save As" and then change it to a "Part Template". This will then make it so that when you open anew Part file and use that template the sketch will always be there.
The second method might be preferred... and just know that just about anything can be saved into a Part, Assembly, or Drawing template.
-
- Posts: 51
- Joined: Mon Dec 20, 2021 1:40 pm
- Location: Thumb Area of Michigan, USA
- x 178
- x 27
Re: Axis lines when creating a new sketch
This is what I'd probably do. Though I have not tried it out to see how it would work with sketch I have used it to have my new part template open with some options turned off or on based on what I what to design.
Re: Axis lines when creating a new sketch
My template has axes in it. I also have a macro to add them to any part/assembly file. These are not sketch axis, but the 3 primary axis that can be used on any sketch/feature. You will likely have to make some changes to the macro, as it relies on the names of the planes being consistent.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
- AlexLachance
- Posts: 2187
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2373
- x 2015
Re: Axis lines when creating a new sketch
Hey fellow frenchie!
There's a few ways you could get what you desire but I think it would be best to know how you use these. Sorry, I've never used Catia
The origin could be displayed also, but that would not necessarly give you the 3 axises you desire.
There's a few ways you could get what you desire but I think it would be best to know how you use these. Sorry, I've never used Catia
The origin could be displayed also, but that would not necessarly give you the 3 axises you desire.
-
- Posts: 195
- Joined: Fri Mar 19, 2021 12:21 pm
- x 37
- x 95
Re: Axis lines when creating a new sketch
Thanks for the helpful macro. Since I do approximately zero programming, I have a beginner-level question, if you don't mind. Can you tell me how to modify the macro to check for existing axes? The reason I need to do this is that some of our company templates have one axis and others have three, but none have no axes.SPerman wrote: ↑Tue Feb 06, 2024 3:58 pm My template has axes in it. I also have a macro to add them to any part/assembly file. These are not sketch axis, but the 3 primary axis that can be used on any sketch/feature. You will likely have to make some changes to the macro, as it relies on the names of the planes being consistent.
image.png
AddAxis.swp
- Glenn Schroeder
- Posts: 1522
- Joined: Mon Mar 08, 2021 11:43 am
- Location: southeast Texas
- x 1759
- x 2132
Re: Axis lines when creating a new sketch
I had the three primary axes in my Assembly template for years, but I only used them for Linear Patterns, so when the enhancement was added allowing us to use planes instead I deleted them.SPerman wrote: ↑Tue Feb 06, 2024 3:58 pm My template has axes in it. I also have a macro to add them to any part/assembly file. These are not sketch axis, but the 3 primary axis that can be used on any sketch/feature. You will likely have to make some changes to the macro, as it relies on the names of the planes being consistent.
image.png
AddAxis.swp
"On the days when I keep my gratitude higher than my expectations, well, I have really good days."
Ray Wylie Hubbard in his song "Mother Blues"
Ray Wylie Hubbard in his song "Mother Blues"
Re: Axis lines when creating a new sketch
Thanks a lot for those suggestions. I looked at them and the solution was super easy : a macro !
So I selected a plane first, then started recording what I wanted to do : clic "sketch button", create 2 lines (vertical + horizontal), job's done !
Created a "new" icon to use the macro just beside the usual sketch button. When you click the button the macro starts.
And you end up in the exact situation as my picture in the first post : sketch mode in the selected plane (or surface), 2 lines already drawn, it's your turn to take the mouse !
Here is the code:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.InsertSketch True
Part.ClearSelection2 True
Dim skSegment As Object
Set skSegment = Part.SketchManager.CreateCenterLine(0#, 0.04014, 0#, 0#, 0#, 0#)
Set skSegment = Part.SketchManager.CreateCenterLine(0#, 0#, 0#, 0.038859, 0#, 0#)
Part.SetPickMode
Part.ClearSelection2 True
End Sub
I have to see how I can modify the code so it also works if I have no surface/plane selected when clicking the button (the script would asks me for a plane/surface before "clicking" the sketch button), but I'm already super happy with that.
Thanks again !
So I selected a plane first, then started recording what I wanted to do : clic "sketch button", create 2 lines (vertical + horizontal), job's done !
Created a "new" icon to use the macro just beside the usual sketch button. When you click the button the macro starts.
And you end up in the exact situation as my picture in the first post : sketch mode in the selected plane (or surface), 2 lines already drawn, it's your turn to take the mouse !
Here is the code:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.InsertSketch True
Part.ClearSelection2 True
Dim skSegment As Object
Set skSegment = Part.SketchManager.CreateCenterLine(0#, 0.04014, 0#, 0#, 0#, 0#)
Set skSegment = Part.SketchManager.CreateCenterLine(0#, 0#, 0#, 0.038859, 0#, 0#)
Part.SetPickMode
Part.ClearSelection2 True
End Sub
I have to see how I can modify the code so it also works if I have no surface/plane selected when clicking the button (the script would asks me for a plane/surface before "clicking" the sketch button), but I'm already super happy with that.
Thanks again !
Re: Axis lines when creating a new sketch
Try making the 3 main planes show (not hidden) and dimension to those. That will work in most situations for what you want to do. I try to dimension to main planes in sketches whenever possible. You can always hide the main planes later, if you don't want them to show in the model.
I do leave the main planes hidden all the time, but select them in the tree when I dimension to them.
Dwight
I do leave the main planes hidden all the time, but select them in the tree when I dimension to them.
Dwight
Re: Axis lines when creating a new sketch
I use them on every part I draw, but I come from NX where coordinate systems were real and powerful tools. Axis are as much a part of my modeling as planes are.Glenn Schroeder wrote: ↑Wed Feb 07, 2024 8:46 am I had the three primary axes in my Assembly template for years, but I only used them for Linear Patterns, so when the enhancement was added allowing us to use planes instead I deleted them.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
- DanPihlaja
- Posts: 849
- Joined: Thu Mar 11, 2021 9:33 am
- Location: Traverse City, MI
- x 812
- x 980
Re: Axis lines when creating a new sketch
You cold just add a coordinate system to your template. It works just as well and is 1 item.
-Dan Pihlaja
Solidworks 2022 SP4
2 Corinthians 13:14
Solidworks 2022 SP4
2 Corinthians 13:14
Re: Axis lines when creating a new sketch
That may be true in 2024, but in 2017, when I started, coordinate systems were all but useless. I had one in my template, before I figured out I couldn't use it's planes or axes.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
- DanPihlaja
- Posts: 849
- Joined: Thu Mar 11, 2021 9:33 am
- Location: Traverse City, MI
- x 812
- x 980
Re: Axis lines when creating a new sketch
Yes that's true. It needs to be SW 2022 or later.
-Dan Pihlaja
Solidworks 2022 SP4
2 Corinthians 13:14
Solidworks 2022 SP4
2 Corinthians 13:14
Re: Axis lines when creating a new sketch
Even in 2022, the CS isn't as useful as it could be. There is no way to select the planes or axes via the history tree.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams