Hi,
I use the Copy Custom Info macro from time to time. We've recently upgraded to 2010 and the macro now crashes the progam when pressing the X or Exit button. Has anyone else had this problem?
Cheers,
M
SolidworksApi macros
Hi,
I use the Copy Custom Info macro from time to time. We've recently upgraded to 2010 and the macro now crashes the progam when pressing the X or Exit button. Has anyone else had this problem?
Cheers,
M
SolidworksApi macros
To save time I'll explain. It's pop up window where you select the custom items. Pressing either exit or X crashes it. Nothing happens other than it freezes and then up pops the SolidWorks recovery window.
Ah I see... it's the one from this page - http://www.esoxrepublic.com/freeware/index.html - CopyCustomInfo--Esox.swp
Option Private Module
'all public declarations are made in this module
Public BoolStatus As Boolean
Public numcust As Integer
Public laThreshold As Integer 'large asembly mode threshold
Public laTrigger As Integer '0=prompt, 1=always, 2=never
Public longstatus As Long
Public Errorss As Long
Public Warningss As Long
Public TargetType As Long
Public TargetConfigCount As Long
Public TemplateType As Long
Public TemplateConfigCount As Long
Public ciCount As Long
Public swApp As Object
Public Target As Object
Public Template As Object
Public fs As Object 'FileSystemObject object
Public TemplateFullPath As String
Public TemplatePathOnly As String
Public TemplateFileName As String
Public TemplateConfigNames() As String
Public CopyName As String
Public CopyFullPath As String
Public TargetFullPath As String
Public TargetPathOnly As String
Public TargetFileName As String
Public TargetConfigNames() As String
Public InfoContents As String
Public ciNames As Variant
Public ciTypes As Variant
Public ciValues As Variant
Public retval As Variant
Public Type swPropParams 'used for writing custom info
pName As String
pType As Long
pValue As String
End Type
'ShellExecute API
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Sub OpenEsoxWeb()
ShellExecute 0, vbNullString, "http://www.EsoxRepublic.com", vbNullString, "C:\", 1
End Sub
That was written in 2003, for SW2003. I'm can't guarantee anything for SW2010.
I am working on an updated version. Slow going, as I am not in a position to put as much time into this as I was back then, and the API has changed much.
Hi,
I personally thank you for writing it in the first place. I've used it on quite a few old parts that had no attributes at all.
If you manange to update it for 2010, then please let me know
Many thanks,
M
Hey Rowland,
Have you had any chance at looking at the macro?
Many thanks,
M
SW2009 32x version now available.
http://esoxrepublic.com/freeware
Sorry that you weren't notified. I did try to find everyone who had asked about it.
Hi There,
Thanks for the update. I've given it a go and get the following error... Although I am using 2010... Any thoughts?
Cheers,
Marc
What is your OS. Also did you tried fixing the missing libraries (Open the macro in an editor, go to Tools > references and look out for missing libraries and replace them with equivalent SW2010 libraries)
Do what Deepak said.
Earlier versions of SW were not nearly as difficult for transitioning macros from one version to the next. Problem gets bigger with each release.
Unfortunately, I'm still using SW2009 32-bit. Thats as far as I can take it from here.
I'm using 2010 on XP
It's strange, that it does actually seem to work once I clear the error... The only thing that does not seem to work, but might not have before is the weight/mass attribute becomes a figure and not the syntax.
M
How about adding codes to program for closing it automatically once it finishes the work.
I did not intend for the program to close automatically. This is because I wanted the user to make multiple copying actions between different configurations.
Agree and that is perfect but I only suggested so that Marc can use the macro till crashing is fixed.