Search found 26 matches

by Jordan Brown
Fri Jan 06, 2023 2:49 pm
Forum: API
Topic: Transform.ArrayData - Cannot apply indexing?
Replies: 10
Views: 1306

Re: Transform.ArrayData - Cannot apply indexing?

My issue is that I need a vector that points in the same direction as the cylinder params, but that has a unit length of 1 (a normalized vector). Unless I am wrong, it is merely a questions of when to do the normalization, before or after the transform. Either way, I need to manipulate the values in...
by Jordan Brown
Fri Jan 06, 2023 2:19 pm
Forum: API
Topic: Transform.ArrayData - Cannot apply indexing?
Replies: 10
Views: 1306

Re: Transform.ArrayData - Cannot apply indexing?

Just curious... What are you trying to do here? It's not often you need to do direct math with the individual elements of a transform... The idea is to get the unit vector of the axis of a cylindrical face. 1. Get CylinderParams 2. Make transform a. Values correspond to 0, 4, 8, 9, 10, 11, and 12 i...
by Jordan Brown
Fri Jan 06, 2023 2:08 pm
Forum: API
Topic: Transform.ArrayData - Cannot apply indexing?
Replies: 10
Views: 1306

Re: Transform.ArrayData - Cannot apply indexing?

Just a shot in the dark, but you may have to create an intermediate line similar to: double[] t1ArrayData = (double[])Transform1.ArrayData Then replace all instances of Transform1.ArrayData[n] with t1ArrayData[n] Agreed, looks like this is what it will have to be. I was hoping to avoid the work sin...
by Jordan Brown
Fri Jan 06, 2023 11:57 am
Forum: API
Topic: Transform.ArrayData - Cannot apply indexing?
Replies: 10
Views: 1306

Re: Transform.ArrayData - Cannot apply indexing?

I have edited the original post to show the complete lines of code. Sorry it is so small, I can't seem to figure out how to make it bigger, these high res monitors have their drawbacks.
by Jordan Brown
Fri Jan 06, 2023 11:35 am
Forum: API
Topic: Transform.ArrayData - Cannot apply indexing?
Replies: 10
Views: 1306

Transform.ArrayData - Cannot apply indexing?

So I have a C# add-in that was originally built in VS2019. I recently upgraded to VS2022 and it is now reporting problems with Transform.ArrayData{}. It gives the following error: Cannot apply indexing with [] to an expression of type 'object' '. This code seems to imply a casting issue, but casting...
by Jordan Brown
Wed Dec 07, 2022 12:34 pm
Forum: SW General
Topic: Features fail randomly in stable model some time after
Replies: 9
Views: 952

Re: Features fail randomly in stable model some time after

I think that the freeze bar would depend on your workflow. When we have extensive surfacing work to do, we design the surfaces in an independent part, export the final thing as a parasolid, and then import into a part that we use in our assemblies. It is certainly a little more work if you need to e...
by Jordan Brown
Wed Dec 07, 2022 10:23 am
Forum: SW General
Topic: Features fail randomly in stable model some time after
Replies: 9
Views: 952

Re: Features fail randomly in stable model some time after

Is this setting turned on? image.png If not, my advice is to turn it on and leave it on. That is a lesson we learned as well. When we do our surfacing and get hundreds of features everything must be perfect. We would sometimes get to the end of a complex part, and then have something fail way up in...
by Jordan Brown
Wed Nov 23, 2022 4:32 pm
Forum: How To Questions
Topic: How to Cut Surface Elements
Replies: 4
Views: 647

Re: How to Cut Surface Elements

You can trim a surface using to a solid as well. OK you will not find a single thing that says it can do it but you can do it. To do this you need to select the solid before you press/select the trim feature. It is that simple, within trim feature you can not select solid to trim to but this bypass...
by Jordan Brown
Wed Nov 23, 2022 1:16 pm
Forum: API
Topic: How to close popups
Replies: 2
Views: 679

How to close popups

Hello, So I have a macro that deletes an old block from a drawing and replaces it in the same location with a new block. On some drawings it works fine and on other ones I get this popup twice whenever it is run. image.png Does anyone know of a way to have the macro close them if/when they pop up? I...
by Jordan Brown
Wed Nov 23, 2022 10:24 am
Forum: API
Topic: Macro for changing selected entity of feature
Replies: 3
Views: 896

Re: Macro for changing selected entity of feature

Maybe not the best way but this is what comes to mind. You could get the name of the face that you selected by your ray and then traverse through the feature tree to find which features all modify that face (by matching the name to the value returned by Ifeature GetFaces). Since multiple features co...
by Jordan Brown
Fri Nov 18, 2022 10:04 am
Forum: How To Questions
Topic: Updating templates for 2022
Replies: 11
Views: 2165

Re: Updating templates for 2022

Same here. Most of our templates "Date modified" property are from between 2008 and 2013. We have never had a problem that I know of.
by Jordan Brown
Tue Nov 08, 2022 2:15 pm
Forum: Macro Library
Topic: macro help needed
Replies: 4
Views: 1579

Re: macro help needed

I cannot find an accessor for the sketch colour in the sketch interface. Unless it is hidden somewhere obscure, I do not think that it can be changed using the API.

Storm
by Jordan Brown
Fri Oct 21, 2022 8:16 am
Forum: API
Topic: Add Button to "Quick Access Tools"
Replies: 6
Views: 957

Re: Add Button to "Quick Access Tools"

Exactly!

Do you know the secret?
by Jordan Brown
Fri Oct 21, 2022 7:42 am
Forum: API
Topic: Add Button to "Quick Access Tools"
Replies: 6
Views: 957

Re: Add Button to "Quick Access Tools"

Perhaps I should have been a little more specific. I was hoping to place a button from my Add-In beside the "Options" button at the top of the Solidworks window...
by Jordan Brown
Thu Oct 20, 2022 5:02 pm
Forum: API
Topic: Add Button to "Quick Access Tools"
Replies: 6
Views: 957

Add Button to "Quick Access Tools"

Does anyone know if it is possible to add buttons, etc. to the quick access tools at the top of the Solidworks window?
image.png
by Jordan Brown
Fri Jul 29, 2022 1:28 pm
Forum: API
Topic: Find Concentric Circular Features on Different Components
Replies: 4
Views: 901

Re: Find Concentric Circular Features on Different Components

Well, that sounds like an idea. I'll give it a try.

Thanks
by Jordan Brown
Fri Jul 29, 2022 1:00 pm
Forum: API
Topic: Find Concentric Circular Features on Different Components
Replies: 4
Views: 901

Find Concentric Circular Features on Different Components

Hello, I am trying to come up with a way to find which features on different components are concentric in an assembly. For example: tapped hole in one part and cut-extrude in another. Any ideas on the best way to go about this? My first thought was to select (via API) all of the temporary axes and t...
by Jordan Brown
Tue Jun 07, 2022 4:42 pm
Forum: API
Topic: PDM API Drawing Node
Replies: 2
Views: 666

Re: PDM API Drawing Node

A cheaters way that I have used before is to get the file path of the part as a string and then change the .sldprt extension to .slddrw.

As long as the part and drawing are in the same folder it works fine. If not it breaks down.
by Jordan Brown
Thu May 12, 2022 9:32 am
Forum: API
Topic: recorded macro not working
Replies: 9
Views: 1416

Re: recorded macro not working

"False" should turn off, and "True" should turn on.

So if you have the bendlines showing, and then run the macro, they do not turn off?

Hard to say what the issue is without seeing more lines from the code. A little more to work with would be helpful :)

Jordan
by Jordan Brown
Thu Mar 10, 2022 7:06 am
Forum: API
Topic: API Select Printer Paper Size - C#
Replies: 2
Views: 815

API Select Printer Paper Size - C#

Does anyone have experience with selecting paper size using C#? There is a great macro on Codestack (here) but it uses a VBA function "Device Capabilities" that, according to me reading, does not exist in C#.

Thanks,
Jordan
by Jordan Brown
Fri Feb 25, 2022 11:26 am
Forum: API
Topic: Cleaning up large assemblies from a STEP import
Replies: 3
Views: 1078

Re: Cleaning up large assemblies from a STEP import

If you are already stepping through the ASM using the api, then you should be able to open each part and then run the import diagnosis. The link to the method is below: http://help.solidworks.com/2021/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.ipartdoc~importdiag...
by Jordan Brown
Wed Dec 01, 2021 7:51 am
Forum: 2D Drawings
Topic: Attach Leader Center as Default
Replies: 3
Views: 1365

Attach Leader Center as Default

Hello,

After a drawing note has been inserted, it is possible to change the leader option to "Attach Leader Center". Does anyone know if this can be changed somewhere in the document properties? I would like to make it the default in our drawing templets.
leader.png
by Jordan Brown
Wed Sep 22, 2021 5:04 pm
Forum: SW General
Topic: Reference Number of Component Instances in ASM Equation
Replies: 0
Views: 515

Reference Number of Component Instances in ASM Equation

Does anyone know of a way to use the qty of a part in an assembly in an equation? i.e. There are 5 of part A in the ASM so D5@Sketch1 = (qty of part A) * 5?

Thanks
by Jordan Brown
Tue Sep 21, 2021 7:49 am
Forum: API
Topic: Just to be sure...PDM Standard can't be accessed via API right?
Replies: 4
Views: 782

Re: Just to be sure...PDM Standard can't be accessed via API right?

That is my understanding. If there is a way around it, I would love to knowl
by Jordan Brown
Fri Jul 23, 2021 7:37 am
Forum: API
Topic: API Create Closed Spline
Replies: 3
Views: 793

Re: API Create Closed Spline

Thanks Eddy, I should have guessed, but the error was not really related to the spline. The message was a generic "Your application has encountered a problem...index value does not exist..." I was sorting a bunch of points using lists. Everything worked fine, until I tried adding my origin...
by Jordan Brown
Wed Jul 21, 2021 3:46 pm
Forum: API
Topic: API Create Closed Spline
Replies: 3
Views: 793

API Create Closed Spline

Hello,

Does anyone have a way for creating a closed spline using the API? I have a macro that creates a spline form points but I can't find a way to close it.

I tried repeating the first point but I received an error.

Thanks,
Jordan