Select Dimension One by one dynamically
Select Dimension One by one dynamically
(OP)
Hi
can anyone help me how to select the dimension one by one dynamically through vba code. The code should work on click of a button I need to select the dimension one by one. I have did the code for single dimension selection and the selected dimension will add to list box. But how to select multiple dimension on single button click.
Regards
Saranya
can anyone help me how to select the dimension one by one dynamically through vba code. The code should work on click of a button I need to select the dimension one by one. I have did the code for single dimension selection and the selected dimension will add to list box. But how to select multiple dimension on single button click.
Regards
Saranya






RE: Select Dimension One by one dynamically
Matt Lorono
Lorono's SolidWorks Resources & SolidWorks Legion
&
RE: Select Dimension One by one dynamically
You can modify the codes to get what you need.
Also check these posts:
Non-Modal Message Box/Input Box
Lotus vs Excel
Deepak Gupta
SW 2009 SP4.1 & 2007 SP5.0
MathCAD 14.0
Boxer's Blog
RE: Select Dimension One by one dynamically
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
Set swDraw = swModel
Set swSelMgr = swDraw.SelectionManager
Set swDispDim = swSelMgr.GetSelectedObject6(1, 0)
Set swDim = swDispDim.GetDimension
If swSelMgr.GetSelectedObjectType3(1, -1) = swSelDIMENSIONS Then
listadditem.AddItem (swDim.Value & " - " & swDim.Name)
Else
MsgBox "Select Only Dimension"
End If
RE: Select Dimension One by one dynamically
1. User runs macro
2. Form appears
3. User selects a dimension (or multiple dimensions?)
4. User pushes a button and dimension information is added to the list
etc.
-handleman, CSWP (The new, easy test)
RE: Select Dimension One by one dynamically
1.User Run macro
2.Form opens
3."Select Dimension" button will be clicked
4. So my program should allow to select dimension
5. Once the dimension is selected then it should add to list
I dont know how to give provision for multiple dimension selection after click of a button
RE: Select Dimension One by one dynamically
1. User runs macro
2. Form appears
3. User cannot interact with the SolidWorks model while the form is on the screen?
-handleman, CSWP (The new, easy test)
RE: Select Dimension One by one dynamically
RE: Select Dimension One by one dynamically
You want:
1. Run macro
2. Form opens
3. User hits "Select dimension" button
4. Macro watches for user to select a dimension
5. When the user selects a dimension it is added to the list
Is that right?
It is much easier and more reliable to program:
1. Run macro
2. Form opens
3. User selects a dimension (or multiple dimensions).
4. User hits "Add selected dimension(s)" button
5. Dimension(s) added to list.
-handleman, CSWP (The new, easy test)
RE: Select Dimension One by one dynamically