Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. fifiririloulou

    Macro to Create Weldment via a User Field

    You can PM me on Reddit (same user name)
  2. fifiririloulou

    Macro to Create Weldment via a User Field

    Hello, Yes all this can be done by macro. Do you create several part with one extrusion each, then do an assembly with those?
  3. fifiririloulou

    Layers macro

    Does it matter if they briefly turn on? Since they will be turn off when deleted anyway?
  4. fifiririloulou

    Layers macro

    Ok. I don't see it on my test file, maybe because it happens too quickly. It might come from the GetItems function, but I don't see any other way to check if the layer is empty.
  5. fifiririloulou

    Layers macro

    The previous macro should do that.
  6. fifiririloulou

    Layers macro

    Define "layers that are not used" in your context
  7. fifiririloulou

    Layers macro

    Maybe I didn't understand your requirement correctly. When you say "unused layers", I assumed it was "layers that don't have any items on them". Is it "layers that are hidden" instead? Something else? I also don't quite understand the problem with: "but also turns on items on layers".
  8. fifiririloulou

    Layers macro

    Try this: Option Explicit Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim swLayerMgr As SldWorks.LayerMgr Dim vLayers As Variant Dim vLayer As Variant Dim swLayer As SldWorks.Layer Dim vItems As Variant Set swApp =...
  9. fifiririloulou

    Macro Help - Place BOM in drawing

    InsertBomTable4 didn't work for some reason and so swBOMAnnotation is Nothing which cause the error later check that : - "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\lang\english\bom-standard.sldbomtbt" actually exists - swView is not nothing with: If swView Is Nothing then Msgbox("View is...
  10. fifiririloulou

    Automating creation of weldment and changing colors of bodies

    This will give each body a random color and put them in a folder Option Explicit Dim xlApp As Excel.Application Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc SetWeldmentParams...
  11. fifiririloulou

    Automating creation of weldment and changing colors of bodies

    If you color every bodies differently, you should create a new feature for each. Then apply the color either to the feature or its body, before looping to the next line.
  12. fifiririloulou

    Automating creation of weldment and changing colors of bodies

    To move the bodies to a cut list folder, you can use MoveToFolder For the color, the best way would be to apply the color to the Structural Member Feature: Sub ApplyColor(swModel As SldWorks.ModelDoc2) Dim vProp As Variant Dim swFeat As SldWorks.Feature Set swFeat =...
  13. fifiririloulou

    Automating creation of weldment and changing colors of bodies

    Try this: Option Explicit Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim swSketch As SldWorks.Sketch Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set swSketch = CreateSketch(swModel) CreateWeldment swModel, swSketch...
  14. fifiririloulou

    replace part in multiple assemblies

    With a macro. Use the function ReplaceComponents2
  15. fifiririloulou

    Iterate trough assembly selection

    Hello, Select some components in the selection tree, then run the code below. It will give their name in the order of the selection. Option Explicit Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim swSelMgr As SldWorks.SelectionMgr Dim swSelComp As...
  16. fifiririloulou

    Swept baffle

    Interesting. Just my 2 cents: I feel like it would be easier to bent and fit between the vertical cylinders if the faces were flat. And easier to weld if those faces were perpendicular to the cylinders faces. That would also avoid the side faces to go to infinity if the horizontal cylinder...
  17. fifiririloulou

    Part Density Using API

    Hello, Only the material is saved in the file. The density, associated with this material, is stored in the material database. Try the following code. Note: go to Tools > Reference and add "Microsoft XML, VX.X" Option Explicit Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As...
  18. fifiririloulou

    Radial Cut

    Revolved cut
  19. fifiririloulou

    Automated Build Check

    Hello, You can use GetWhatsWrongCount Method to get the number of build errors. And GetWhatsWrong Method to get details on each error. Those methods can be used in a third party command line application, but Solidworks need to be installed to open the document.
  20. fifiririloulou

    Solidworks Stuctural Steel Drafting

    You can auto-generate the drawing of each individual body with macro. I've done it for a client. I don't know what "Keeping track of similar items" entails, but you might do that with macro too.

Part and Inventory Search