AutoCAD VB :: How To Make The Selected Value In Combobox Current Layer In Drawing
Dec 19, 2012
Private Sub UserForm_Initialize() Dim layerColl As AcadLayers Dim entry As AcadLayer Dim LayList As String Set layerColl = ThisDrawing.Layers For Each entry In layerColl ComboBox1.AddItem entry.Name Next End Sub
I have a form with a combobox. That combobox is filled up with all layers in a drawing. (see above)
Now I want to make the layer that I have selected (value) in the combobox the current layer in my drawing.
When I set a layer as current, every object or line I select in the drawing appear to be on that layer in the toolbar. Although in the properties toolbox, I see that the line I selected is still on the right layer.
I can't work in paperspace either, when I freeze a layer it freezes all objects. It seems like whenever I give a different layer to an object, it attributes to all object that same layer.
When I open the same drawing in acad 2008, everything is ok, the objects have the proper layers.
Is there a command for that or it's an acad 2013 problem?
When i click on the green line has you can see on the image. The layer toolbar wont show me the right layer, like if it's not working. But i can see the right layer inside propreties.
Is there a system variable to ajust to see my layers inside the Layer tool bar?
Just starting to use 2014, and so far not so good. I tend to keep the Properties Palette open and docked. In 2014, if my current layer is 0, any object I select in a drawing shows as Layer 0 in the Design tab of the Properties palette. If I change to a different layer, any object selected shows that layer in the Properties palette. If I start a new drawing, enter WALLADD and draw a wall segment, the A-WALL layer now correctly appears in the Layer Manager, but when I select the wall, the Layer in Properties is the current layer, not the A-WALL layer it should have gone on. Also, Quick Properties is on, but doesn't pop up anywhere.
I have a form with a combobox and a commandbutton.
All layers in the layermanager must be locked except the active layer chosen in the combobox. I try it with this code but it’s not the right solution.
Private Sub CommandButton1_Click()Dim layer As AcadLayer'check if all layers are lockedIf layer.Lock = False Thenlayer.Lock = True'make the layer selected in the combobox currentThisDrawing.ActiveLayer = ThisDrawing.Layers.Item(ComboBox1.Text)End SubPrivate Sub UserForm_Initialize() Dim layerColl As AcadLayers Dim layer As AcadLayer Dim LayList As String ' all layers locked For Each layer In ThisDrawing.Layers If layer.Lock = False Then layer.Lock = True End IfNext 'fill combobox Set layerColl = ThisDrawing.Layers For Each layer In layerColl ComboBox1.AddItem layer.Name Next End Sub
2. When I choose the for next method to lock all layers (40 layers) it’s very slow.
Is there a macro/script/deisel that will automatically print a pdf (cute pdf autocad lt 2007) to current plot settings in current drawing directory and give it the current drawing view name and number? Disk space not a problem these days and would save time to have a pdf copy of all drawing tabs readily stored in the directory ready for issue.
Open a new document in AI (CS5/CS6), and then draw some arts (rectangles), given an original point (such as 0,0), now I want to all arts in current layer rotate 30 degree around the origin. How to realize it?
When I have an PSD icon set and I want to size a layer to a size that looks good. How do I see the dimentions of that layer so that I can select another layer and make it the same size.
I'm relatively new to Autocad so still learning the ropes.
I've been given a set of drawings from a client to design a system on. What I want to do is turn the drawing they have given me into one layer so that I can turn it on and off to just see my system. Is this possible? If so how?
The drawing has about 300 layers currently and a lot of blocks as well.
I'm currently using AutoCAD LT 2012 and when I create a new layer and set it as current in the layer manager, regardless of what color I set the new layer to, the new layer's color remains the same as the previous one in the properties box even though the colors of the layers are always set to "by layer."
Inside my current action, I have this Axis+Image with some keyframes on opacity and transformation, also some keyframes on X blur/Y blur in my Media list. How do I recycle this setup for other Action?
I tried the save selected object, but when I load it from other action, using Add Nodes + Media method, only the Axis and Image show up (with keyframes). The Media of it shows empty.
I'm having issues with Civ3d 2013. I pushed off upgrading from 2012 because of the format change and the service pack release. I was hoping little glitches would be fixed.
Here are the a couple of glitches to date that I have seen no resolution to in the long list of threads.
1. Layer filters do not filter, unless I have checked "Apply filter to toolbar". The problem is, I dont want to apply them to the toolbar.
2. Publishing to PDF - when set to lines merge (set in the page layout and the publish setting), the wipeouts dont work, and the background masks on leaders makes a faint border around the text in the PDF. When set to overwrite, to get the wipeouts to not print to the PDF as a big black blob, they have to be on a layer set to color 255. I can work around most of the wipeouts, except for dimensions because the background mask doesn't seem to take.
way to do this from the layers menu (ctrl-click new layer icon), but is there a key combo? I use shift-ctrl-n a lot to make new layers, but often I need to make a new layer *below* the current layer.
I Want to change the View of viewport according to the Combobox change event. the drawing is updating only after exiting the macro. My aim is to view my 3D object in different views and to modify it.
Here is my code.
Private Sub UserForm_Initialize() ComboBox1.AddItem "Top" ComboBox1.AddItem "Left" ComboBox1.ListIndex = 0 End Sub
Private Sub ComboBox1_Change() ThisDrawing.SendCommand "-View" & vbCr & ComboBox1.Text & vbCr ThisDrawing.Regen acActiveViewport End Sub
I want to make a layer from external reference current.
I tried to identify it with its full name, but I got an error: eInvalidInput. So I found out, I have to use only the part behind the pipe.But then there is a problem, because this name is not unique withing the drawing.
Any number of xrefs can have such layer and also the drawing itself can have a layer with the same name. How exactly can I set a layer from xref current?
example:
layer from xref1: Xref1|LayerName1 layer from xref2: Xref2|LayerName1 layer from the drawing: LayerName1
Is there a way to lock the current layer (to say layer 0) so that is STAYS the current layer regardless of my isolating, turning layers on and off etc?
Really annoying to keep getting those "Are you sure you want to turn off the current layer" messages and it would prevent me from either drawing thing on a layer I don't intend to, or drawing on a layer which is off (which confuses me every time).
How to make a current date block? I've also looked for the file location block attribute. I know it exists cuz the architect in this office used to have it. When he quit, he took it out of the pc's.
I am trying to write a quick macro to open the current drawing in the block editor. I can easily do the steps from the dialog box to open the current drawing, but the command line version give me an error.
Command: -bedit Enter block name or [?]: <current drawing>
(A message box pops up saying, "The name cannot be longer than 255 characters."
If I click ok on the message box, AutoCAD returns to model space. The file name is 30 +/- characters, and the path is maybe another 50 to 100 characters. Can I bedit the current drawing using the command line, or must I use the dialog box?