-
Re: Set -Per Standard- as active layer
Jacob Cordingley Jan 25, 2010 3:29 PM (in response to Paul Marsman)Set LayerMgr = Drawing.GetLayerManager
LayerMgr.SetCurrentLayer ("?")
-
Re: Set -Per Standard- as active layer
Paul Marsman Jan 25, 2010 4:17 PM (in response to Jacob Cordingley)Jacob,
Yes, that is the command I'm using but when I say: LayerMgr.SetCurrentLayer ("-Per Standard-") it doesn't change anything. Could you verify that you can actually set the active layer to the "Per Standard" layer?
-
Re: Set -Per Standard- as active layer
Jacob Cordingley Jan 25, 2010 4:30 PM (in response to Paul Marsman)Dose the Layer -Per Standard- show up in the list of layers
I don't hve a layer call -Per Standerd- try Per Standerd
have one called Rev A
Dim swApp As SldWorks.SldWorks
Dim LayerMgr As SldWorks.LayerMgr
Dim draw As SldWorks.ModelDoc2
Sub main()Set swApp = Application.SldWorks
Set draw = swApp.ActiveDoc
Set LayerMgr = draw.GetLayerManager
LayerMgr.SetCurrentLayer ("Rev A")
End Sub-
Re: Set -Per Standard- as active layer
Paul Marsman Jan 25, 2010 4:44 PM (in response to Jacob Cordingley)I believe this was introduced in 2009 along with the "Drafting Standards" so you wouldn't see it since you are running 2008. But it appears the same as the -None- layer, can you set your active layer to that? -
Re: Set -Per Standard- as active layer
Jacob Cordingley Jan 25, 2010 5:15 PM (in response to Jacob Cordingley)LayerMgr.SetCurrentLayer ("") will change it to -None--
Re: Set -Per Standard- as active layer
Paul Marsman Jan 26, 2010 12:09 PM (in response to Jacob Cordingley)-
Re: Set -Per Standard- as active layer
Jacob Cordingley Jan 26, 2010 12:15 PM (in response to Paul Marsman)set the Layer to the -Per Standard-
then run
swLayerMgr .GetCurrentLayer
this should give you the name
-
Re: Set -Per Standard- as active layer
Paul Marsman Jan 26, 2010 12:35 PM (in response to Jacob Cordingley)I get ""
-
-
-
-
-
-
-
Re: Set -Per Standard- as active layer
Paul Marsman Jan 27, 2010 11:27 AM (in response to Paul Marsman)any ideas out there?-
Re: Set -Per Standard- as active layer
Luke Malpass Feb 3, 2010 8:42 AM (in response to Paul Marsman)The reason is that Per Standard isn't actually a layer. Try placing something on it. All it will do is automatically place the item selected onto the standard layer (typically -None-) which can be changed in settings, so trying to do it by API is invalid.
If you want to do it the closing you can come is to find out the standard layer and get its name then set it that way.
-
Re: Set -Per Standard- as active layer
Paul Marsman Feb 3, 2010 9:37 AM (in response to Luke Malpass)Luke,
I know it isn't actually a 'layer' but neither is -None- really, and we can set that with "", so I figured they should have something for this.... you know, like Black is actually not a color but a lack of color... but I digress.
Anyway... what I'm trying to use this for is to bring old drawings up to date with a macro. I can set the Drafting Standard information, but in order to really use that you need to use the -Per Standard- layer as you said. My VAR put in a SR for me, so we'll see what they say.
-
Re: Set -Per Standard- as active layer
Paul Marsman Feb 3, 2010 1:01 PM (in response to Luke Malpass)woah... changed up the avatar... threw me for a loop a second there.-
Re: Set -Per Standard- as active layer
Luke Malpass Feb 4, 2010 5:41 AM (in response to Paul Marsman)Hehe.
As stated the layer -Per Standard- is pre-defined so just try changing a line or something to the -Per Standard- Layer and see where it goes. Then set them all to that layer in your macro. I don't believe the setting is retro-active so if you later change the -Per Standard- it will not go back and update anything before the change. I cannot confirm this but that is what I suspect as there is no internal layer ID for the per standard layer so I see no way of SW easily tracking the difference.
-
-
-
-
Re: Set -Per Standard- as active layer
Paul Marsman Feb 11, 2010 9:08 AM (in response to Paul Marsman)SPR 537857-
Re: Set -Per Standard- as active layer
Paul Marsman Aug 5, 2013 11:37 AM (in response to Paul Marsman)So.......apparently nobody else had voted for this SPR in two years and it automatically therefore goes "Closed (Inactive)" which is interesting since a few other people on the forums have expressed the need to do this also, yet SW has no way to do this through API.
PLEASE VOTE FOR THIS SPR!!!
-
Re: Set -Per Standard- as active layer
Deepak Gupta Jun 23, 2016 3:38 PM (in response to Paul Marsman)-
Re: Set -Per Standard- as active layer
Paul Marsman Jun 24, 2016 8:17 AM (in response to Deepak Gupta)Thanks Deepak
2009-2016... not too bad I guess
-
Re: Set -Per Standard- as active layer
Deepak Gupta Jun 24, 2016 9:10 AM (in response to Paul Marsman)Well good thing is that it is finally coming. I was in really bad need for this last night.
-
-
-
-
-
Re: Set -Per Standard- as active layer
Jo Nijs Sep 6, 2012 7:46 AM (in response to Paul Marsman)Is this SPR fixed already?
I can't figure out how to set -Per Standard- as current layer.-
Re: Set -Per Standard- as active layer
Paul Marsman Sep 6, 2012 8:35 AM (in response to Jo Nijs)not that I see, you are more than welcome to add your name to the list!!!
-
Re: Set -Per Standard- as active layer
Justin Strempke Nov 20, 2012 5:17 PM (in response to Paul Marsman)I'm having issues with this as well, no -Per Standard- option for Layers (despite the wonderful Help file...). I've config'd them in the Doc Options, but when working they default to the active layer. Tried in both SW2012 and 2013. Where can I sign up!?
-
Re: Set -Per Standard- as active layer
Paul Marsman Nov 21, 2012 7:40 AM (in response to Justin Strempke)Justin,
You'll have to go to the Customer Portal > Knoledge Base and search for SPR 537857. Click on the link to open it and on the left pannel there is a few options, just make sure you select the "Yes, but notify me when this is fixed. (SPR only)" radio button and submit. That adds your name to the votes and they will notify you when it is fixed.
In the mean time you'll have to set the -Per Standard- layer manually with the toolbar, then you won't have the issue of SW not following what you set up in the document options.
Paul
-
Re: Set -Per Standard- as active layer
Justin Strempke Nov 21, 2012 9:25 AM (in response to Paul Marsman)Paul,
Thanks, and I'll have to look into that. As for the temporary fix, what are you meaning? I cannot find any way to set a lay Per Std, either with the toolbar, the item properties, doc properties, or general properties. I've tried creating a layer named that, in hopes SW would just recognize it - didn't work (didn't think it would, but worth a shot!). If you have a method please detail!
-
Re: Set -Per Standard- as active layer
Paul Marsman Nov 21, 2012 3:50 PM (in response to Justin Strempke)-
Re: Set -Per Standard- as active layer
Justin Strempke Nov 21, 2012 4:26 PM (in response to Paul Marsman)haHA, got it! I was looking in the Line Format menu, under Layer Properties. It wasn't showing up there, but neither was -none- so I didn't figure it should. But I didn't have a choice any other location to edit this, even looking through the Customize Commands and running macros - thanks!
-
-
-
-
-
-