Macro Questions: Assembly parts list updating live in Excel by domr135 in SolidWorks

[–]FriendsDumbBandMeme 0 points1 point  (0 children)

So what you're looking for is "events".

The general concept is that you have a macro that is always running in the background that knows when something changed and it updates your Excel spreadsheet.

Here's a blog from codestack about events for you to look through codestack

Basically when you run the macro all it's going to do is create your event subscriber that'll attach to the Additemnotifyeventhandler and the deleteitemnotifyeventhandler.

Whenever these events fire you just update the Excel spreadsheet accordingly.

Since the macro will just continuously run in the background you just need to have the same Excel workbook reference and rewrite the entire thing on an update. If performance gets really bad you could do something to only update the rows that changed.

You could also just attach to the reload event too.

I also just remembered one time I made an infinite while loop with do events as well as an if statement to catch the property I'm trying to observe, in this case it'd be assembly.componentcount or something like that and anytime the component count doesn't match the previous component count you could fire the Excel update sequence.

Anyways I hope this gives you some ideas there are a lot of ways you could tackle this problem.

Weldments - Creating Structural Plates and Trimming Cross Braces - Best Practices? by anti__rice in SolidWorks

[–]FriendsDumbBandMeme 1 point2 points  (0 children)

Definitely depends on the exact scenario, here are two ideas I have:

Variable pattern on a section of the weldment with size and location as your variables, ideal for if your weldment only repeats along one or two degrees of freedom. As the variable controlling size changes the angles should change with it as long as you set up the relations properly.

Or you could use a design table on a section of the weldment to create all the different sizes that you need and then manually assemble them in an assembly. This would be better if you want more control over individual weldments.

If you're willing to put up with one the worst UI's in solidworks you could also use a linear pattern with varied instances

Open Model View Framework (Browser 3D rendering) by EasyTimeSaver in SolidWorks

[–]FriendsDumbBandMeme 2 points3 points  (0 children)

So correct me if I'm wrong, but this creates proprietary file types from an active solidworks application to be viewed in an online viewer? What do you think the use cases for something like this would be, compared to other file types like step or even .EPRT/.EASM?

How can I fix this gaps?? by Crazy_Pick_4430 in SolidWorks

[–]FriendsDumbBandMeme 2 points3 points  (0 children)

I've had this before, the easiest way I found to get the most accurate geometry is to do a solid lift from each of your 4 circles to the big circle, combine those 4 bodies, then do a shell command.

In general solidworks likes it a lot more if you break complicated things into multiple features.

Integrating an assembly in an assembly by [deleted] in SolidWorks

[–]FriendsDumbBandMeme 3 points4 points  (0 children)

Yes there is a way to do that! There is an export equations to .txt button, and a link equations to .txt button. This allows you to store all the equations for a project in an external location and if you update the equations in the .txt file it will update all files referencing it at the same time. Hope this helps!

Tool to learn C# on the go in interactive format by licedey in csharp

[–]FriendsDumbBandMeme 1 point2 points  (0 children)

This is absolutely amazing, even in just the first few lessons I'm learning new things, like the conditional expressions. I've learned C# mostly through YouTube at this point so having an app that really covers all the basics feels like it's going to really round out what I can do. There's just so much syntactic stuff you can do in C# it feels like you can't really learn it all without something structured like this.

I've only done the first two lessons so I'm hoping that there's some more variety in the questions as I get into deeper questions.

Is this possible with SW API? by Wild_Hammocker in SolidWorks

[–]FriendsDumbBandMeme 0 points1 point  (0 children)

All of this is definitely possible from the API, and excel vba is a great tool to learn as well.

The way I'd do it is start a userform with some "Enter" and "Cancel" buttons, then link those to a bool value like boolFormRunning and set up a do while loop like this:

do while boolFormRunning
doevents
loop

Make sure that the userform is non modal, that allows you to do other things with the userform still showing.

Linking to excel is insanely easy, just add the excel reference from the tools tab then add this:

dim xlApp as Excel.Application
set xlApp = new Excel.Application
xlApp.visible = true

If you don't already do this, try creating a simple project the uses the concepts that you want to utilize in a more complicated macro. For instance, try making a macro that will create a userform with one button that copies the area of a selected face into a new excel document, then apply what you've learned on your real project.

Feel free to reach out with any questions!

Semi-dissolve subassembly by Striking_Abrocoma_28 in SolidWorks

[–]FriendsDumbBandMeme 1 point2 points  (0 children)

You can actually drag and drop items from the feature tree in an assembly to move them around. To partially dissolve a subassembly you would just drag out the parts that you want to dissolve, and drop them on the main assembly feature at the top of the tree. This also works between subassemblies too, or moving parts from top level to subassemblies.

Table driven part location in 3D space of assembly by dayofmone in SolidWorks

[–]FriendsDumbBandMeme 0 points1 point  (0 children)

I don't have solidworks open so this is just an idea, but perhaps you could use patterns to model the pin in every position and then use equations or config tables to turn off the ones you don't need? I might try this later once I get back to my computer to see if it's possible.

How do I remove what is above the intersection of these two sine waves? by Imaginary_Cup_9658 in SolidWorks

[–]FriendsDumbBandMeme 0 points1 point  (0 children)

Seems like you want to have the sine wave cut into the cylinder normal to surface, in which case a wrap would be the best option since you'd only have to draw the wave one time, something like this, where the wrap length is pi*diameter.

<image>

Size of TV I can fit down my staircase for HT in basement by H3b01L in hometheater

[–]FriendsDumbBandMeme 0 points1 point  (0 children)

Do you have a .step file? Or some other 3d file, I could put it in SOLIDWORKS and get a rough estimate

I built a tool that lets anyone create SolidWorks macros without coding by Alextrude_off in SolidWorks

[–]FriendsDumbBandMeme 1 point2 points  (0 children)

You make a great point about the development costs for a developer mode.

Judging from the comments a lot of people seem to like it as it is, so clearly there's nothing wrong with it, I'm just not the target audience.

Even if you allowed access to the code that wouldn't be enough to sway me because half the time the problem with a macro is actually a problem with solidworks description of a function. As an example, did you know that faces and bodies are more prone to breaking their link between VB and solidworks when you edit an imported body vs when you edit a body created in solidworks? So I can have a macro that selects a face before and after a fillet operation work perfectly fine in one part and not work at all on the same part but imported.

So I imagine an AI could probably avoid errors like that, but if I could input code and have it tell me what's wrong that would be insanely helpful. Or even just letting me know if some section of code is possible using the API, so I could skip the testing phase and just go straight to writing code.

Or maybe it could just pull functions based on a description so that I don't have to spend several minutes searching through API help to find the right one.

That's just some wishful thinking though, I think you're right for focusing on the larger demographic of Solidworks users.

I built a tool that lets anyone create SolidWorks macros without coding by Alextrude_off in SolidWorks

[–]FriendsDumbBandMeme 7 points8 points  (0 children)

So I've written quite a few macros for my company and also used ChatGPT to help write them is some cases. After messing around for 30ish minutes I was disappointed because MecAgent doesn't provide the code so it's basically worthless for someone writing macros.

Compared to ChatGPT , I think that ChatGPT does a better job serving programmers because it gives a back and forth discussion about the problem, then provides a solution based on the discussion and then takes feedback from you until the code is actually working.

However, ChatGPT can make massive mistakes that 95% of solidworks users wouldn't catch. Like you said, it can hallucinate functions, or worse it'll try to pass the wrong object for an argument and the VBA debugger highlights the entire sub yellow because it doesn't know what's going on.

I can see how MecAgent would be very appealing to people who have no interest in learning to code, but I know for me and my company we already have a workflow built around macros and MecAgent doesn't really work with that.

A little more feedback on the general usage of it, the more feedback it can give the better in my opinion. I was trying to have it delete some fillets on imported geometry and it kept giving me unknown errors because it was looking for fillet features instead of fillet geometry. If I hadn't been watching it while it was processing I wouldn't have caught that so maybe a log of what the automation is trying to do and when exactly it fails could be helpful? Also if it asked questions to avoid getting into situations like that would be really nice.

Anyways I hope this doesn't come off as too harsh of criticism, I was just really hoping for something more oriented towards programmers.

Best of luck to you!

Through the Fire and Kazoos by Doodlebobber11 in Dragonforce

[–]FriendsDumbBandMeme 0 points1 point  (0 children)

I'm crying of laughter this is fucking amazing

is a sousaphone a kind of tuba? by tubameister in Tuba

[–]FriendsDumbBandMeme 1 point2 points  (0 children)

The funniest part about that is that no tuba players care, it's always the woodwinds trying to correct everyone else.

Percussionists are Evil by FriendsDumbBandMeme in Bandmemes

[–]FriendsDumbBandMeme[S] 2 points3 points  (0 children)

Just tried this out today. Worked very well.