Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Search results for query: *

  • Users: dsi
  • Order by date
  1. dsi

    AutoOpen & AutoClose

    You can use the Workbook_Open and Workbook_Close event within the ThisWorkbook module in the VB Editor to accomplish what you are looking for. DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
  2. dsi

    Excel, how can I loop my Sub routine in Milliseconds

    The result is returned as a single. The decimal places represent the smaller portions of a second. For one millisecond (1/1000th of a second), you would use the decimal 0.001 seconds. DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums...
  3. dsi

    Excel, how can I loop my Sub routine in Milliseconds

    Look into the Timer function. DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
  4. dsi

    Asking user a password in VBA

    You can create a form, add a textbox, and change the Textbox.PasswordChar property. If you enter an asterisk "*", you'll have the standard masked entry field. DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums for the benefit...
  5. dsi

    autocad vba listbox

    If you are in the code window for the form, you don't need to add the form name, simply use the control name. ListBox1.AddItem "8000" DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
  6. dsi

    autocad PAGE SETUP

    You can access the properties from the ModelSpace or PaperSpace objects. Ex. ThisDrawing.ModelSpace.Layout.PlotType = acExtents ThisDrawing.ModelSpace.Layout.StandardScale = acScaleToFit ThisDrawing.Plot.NumberOfCopies = 1 ThisDrawing.Plot.PlotToDevice DimensionalSolutions@Core.com...
  7. dsi

    Cosmos constraint in the shape of an unmodeled surface?

    I am not sure I completely understand your model, but you can create a sketch of the cross section on the face it would be contacting. Then, rebuild, select the sketch and the face and do an Insert > Curve > Split Line. This will create a separate selectable face on the main face to which you...
  8. dsi

    Getting rif of #DIV/0!

    You can use an If statement to see if the denominator is zero. If so, set the cell to an empty string otherwise display the result. DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
  9. dsi

    VB for WinCC question

    That may work. Also, if Test is an object, you'll have to define it using the Set method. Sub OnLButtonDown(...) Dim dummy, Test Set Test = HMIRuntime.Tags(“Test”) Dummy = HMIRuntime.Tags(“Dummy”).value If Dummy = 1 Then Set Test = HMIRuntime.Tags(“Pers3”) ElseIf Dummy = 2...
  10. dsi

    VB for WinCC question

    First thing I notice is that you are comparing an object to a value. The Set command indicates you are setting an object. Objects can not be compared to values. You may have to access a property of the object to compare it to. Set Dummy = ... If Dummy = 1 - Probably causing problem Maybe...
  11. dsi

    API - False Negatives with Active Doc

    Does the above method not work for trapping the situation? DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
  12. dsi

    PC User Name

    You can access the login name using several methods. Via Windows API (preferred and most reliable method) Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Public Sub Main() Dim sUser As String Dim...
  13. dsi

    Goalseeking to a minimum vlaue

    If you refer to Jkaen's post, you'll see it is the macro he wanted to run between calculations. I can only presume that the automatic sheet recalculation did not trigger his custom calculations, requiring it to be run for each step. Glad to help... DimensionalSolutions@Core.com While I welcome...
  14. dsi

    API - False Negatives with Active Doc

    rocheey: Actually, I am not sure. I just assumed that the ActiveDoc failed because a document was not active. I also thought that this method would work around that issue because it returns all documents, regardless of their active status. Since the swApp is still hooked, it should function (at...
  15. dsi

    API - False Negatives with Active Doc

    Here is a more detailed function for Option 2 mentioned above. You can modify your code to include the test. If Model Is Nothing Then If IsFalsePositive = False Then swApp.SendMsgToUser2 "A file must be opened..."... Else 'At least one file is open, but SW is not the...
  16. dsi

    API - False Negatives with Active Doc

    Option 1: You may have to dig into the Windows API to make sure that SolidWorks is the active window. However, I am not sure why the macro would trap the keypad use if it's not the active application. Option 2: Put an additional trap to catch this situation. You obviously need to use the...
  17. dsi

    API: EnumDocuments2.Next

    Yeah, it does seem to have difficulty as advertized. Since you are only fetching one modeldoc at a time, I just lost the array. Private Sub cmdEnum() Dim eList As SldWorks.EnumDocuments2 Dim eItem As SldWorks.ModelDoc2 Dim Celt As Long Dim rGelt As Object Dim pCeltFetched As...
  18. dsi

    scale with vba

    glad to help... DimensionalSolutions@Core.com While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
  19. dsi

    scale with vba

    Why don't you just process this via the command line? Instead of creating a selection set of a ton of entities, utilize the "ALL" method already built into AutoCAD. ThisDrawing.SendCommand "_Scale" & vbCr & "ALL" & vbCr & vbCr & "0,0,0" & vbCr &...
  20. dsi

    Excel to Autocad

    Using VBA you can access the text items and append the data from Excel. You could write the program in Excel VBA, include the AutoCAD object library and you're on your way. It shouldn't be that complex, but will take a little time to write. DimensionalSolutions@Core.com While I welcome e-mail...
Back
Top