<?xml version="1.0" encoding="iso-8859-1"?> 
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
  <title>SolidWorks - API</title> 
  <description></description> 
  <link>https://forum.solidworks.com/forum/index.cfm?forumid=3</link> 
  <generator>FuseTalk Enterprise Edition</generator> 

	
	<item>
		<title>Handles and Class Names - Who do you trust?</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14718</link> 
		<pubDate>Sat, 06 Sep 2008 17:54:52 EST</pubDate> 
		<dc:creator>William Crosby</dc:creator>
   	    <slash:comments>1</slash:comments> 
		<description><![CDATA[ Here's a routine I created to capture the hWnd and Class name to use in a prog. SolidWorks says one thing and Windows states another. Now I'm capturing the nWnd for the Windows side using the swCaption MDI object which is the nWnd primary frame's caption for SolidWorks from Windows, so what is SolidWorks keying off of for the frame. So the question is whom do you trust? Create a VBA module and copy/paste code below and run you'll see.<br /><br />'------- CODE ----------<br />Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long<br />Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long<br /><br />'Purpose   :    Returns the Windows Handle of a Dialog based on its caption.<br />'Inputs    :    sDialogCaption                  The dialog caption.<br />'               [sClassName]                    The class name of the dialog. If unknown, do not specify<br />'                                               this parameter.<br />'Outputs   :    The Dialogs Window Handle<br />'Notes     :    1/  Find windows scans down the Z Order of the dialogs currently displayed,<br />'               2/  To Call in a VBA form use:      lHwnd = DialogGetHwnd(Me.Caption)<br />'               3/  Use Spy ++ (comes with Visual Studio), OR the function DialogGetClassName to<br />'                   return the class names of forms.<br /><br />Function DialogGetHwnd(ByVal sDialogCaption As String, Optional sClassName As String = vbNullString) As Long<br />    On Error Resume Next<br />    DialogGetHwnd = FindWindowA(sClassName, sDialogCaption)<br />    On Error GoTo 0<br />End Function<br /><br />'Purpose     :  Returns the class name of a object given the handle or caption<br />'Inputs      :  [sCaption]      =       The objects caption<br />'               [lHwnd]         =       The objects handle<br />'Outputs     :<br />'Notes       :  Pass in either sCaption OR lHwnd, to get a class name<br /><br />Function DialogGetClassName(Optional sCaption As String, Optional lHwnd As Long) As String<br />    Const clMaxLen As Long = 256<br />    Dim lRetVal As Long, sResult As String * clMaxLen<br />    <br />    If Len(sCaption) Then<br />        'Get Dialog Handle<br />        lHwnd = DialogGetHwnd(sCaption)<br />    End If<br />    If lHwnd Then<br />        'Get Class Name<br />        lRetVal = GetClassName(lHwnd, sResult, clMaxLen)<br />        DialogGetClassName = Left$(sResult, lRetVal)<br />    End If<br />End Function<br /><br />Sub main()<br />Dim swApp As SldWorks.SldWorks<br />Dim swhWnd As Long, winhWnd As Long<br />Set swApp = Application.SldWorks<br />swhWnd = swApp.Frame.GetHWnd ' Get SolidWorks windows handler from SolidWorks<br />swClsname = DialogGetClassName(vbNullString, swhWnd) ' Get SolidWorks class name from SolidWorks<br />winhWnd = DialogGetHwnd(swCaption) ' Get SolidWorks windows handler from Windows<br />winClsname = DialogGetClassName(vbNullString, winhWnd) ' Get SolidWorks class name from Windows<br />MsgBox "SW Handle for SW: " & swhWnd & vbCrLf & "SW Class for SW: " & swClsname & vbCrLf & "Win Handle for SW: " & winhWnd & vbCrLf & "Win Class for SW: " & winClsname<br />End Sub<br /> ]]></description>
	</item>

	
	<item>
		<title>Setup Units</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14711</link> 
		<pubDate>Sat, 06 Sep 2008 00:15:59 EST</pubDate> 
		<dc:creator>Mario Linares</dc:creator>
   	    <slash:comments>2</slash:comments> 
		<description><![CDATA[ I am using solidworkd 2007. The software has the units setup in "millimeters". However, I want to work in "inches".<br />I have changed the units to inches and save my part and drawing. However, when I open a new part the software keeps the "millimeteres" instead.<br />How can I setup  SW to keep the units in "inches" for the new parts and drawings all the time?.<br /><br />Thanks.<br />Mario ]]></description>
	</item>

	
	<item>
		<title>place component automaticaly base on coordinate system</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14708</link> 
		<pubDate>Fri, 05 Sep 2008 19:43:22 EST</pubDate> 
		<dc:creator>Ahmad Zulker</dc:creator>
   	    <slash:comments>6</slash:comments> 
		<description><![CDATA[ Hi Guys....<br /><br />I want to place a component into assembly automatically base on coordinate system. How to handle this case, any experience on this ?<br /><br />See attached image...<br /><br />Thanks!<br /> ]]></description>
	</item>

	
	<item>
		<title>Can&apos;t get InsertDerivedPattern to work</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14702</link> 
		<pubDate>Fri, 05 Sep 2008 14:42:29 EST</pubDate> 
		<dc:creator>Mahir Abrahim</dc:creator>
   	    <slash:comments>2</slash:comments> 
		<description><![CDATA[ I'd like to automate the creation of feature driven component patterns.  Based on the API help it seems relatively simple, but nothing happens when I run the code below.  Everything seems to work as expected until the InsertDerivedPattern command is called.  No pattern feature is created. The swFeat variable remains Nothing.<br /><br /><hr><br /><div class="FTQUOTE"><begin quote>Sub main()<br />    Dim swApp       As SldWorks.SldWorks<br />    Dim swDoc       As SldWorks.ModelDoc2<br />    Dim swFM        As SldWorks.FeatureManager<br />    Dim swSelMgr    As SldWorks.SelectionMgr<br />    Dim swFeat      As SldWorks.Feature<br />    Dim iNumSel     As Integer<br />    Dim i           As Integer<br />    Dim bool        As Boolean<br />    <br />    Set swApp = Application.SldWorks<br />    Set swDoc = swApp.ActiveDoc<br />    <br />    If swDoc.GetType <> swDocASSEMBLY Then Exit Sub 'Exit if no assembly open<br />    <br />    Set swFM = swDoc.FeatureManager<br />    Set swSelMgr = swDoc.SelectionManager<br />    <br />    iNumSel = swSelMgr.GetSelectedObjectCount<br />    If iNumSel > 1 Then<br />        For i = 1 To iNumSel<br />            If i = iNumSel Then<br />                bool = swSelMgr.SetSelectedObjectMark(i, 2, swSelectionMarkSet)<br />            Else<br />                bool = swSelMgr.SetSelectedObjectMark(i, 1, swSelectionMarkSet)<br />            End If<br />        Next i<br />        <br />        Set swFeat = swFM.InsertDerivedPattern<br />    End If<br />    <br />    Set swApp = Nothing<br />    Set swDoc = Nothing<br />    Set swFM = Nothing<br />    Set swSelMgr = Nothing<br />End Sub</end quote></div> ]]></description>
	</item>

	
	<item>
		<title>Import Part Custom Property into MSWord</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14701</link> 
		<pubDate>Fri, 05 Sep 2008 14:21:12 EST</pubDate> 
		<dc:creator>Marc Godbout</dc:creator>
   	    <slash:comments>2</slash:comments> 
		<description><![CDATA[ Is there a simple way to import a SW custom property into MSWord? For example, import a part's "Description" property value into a Word document. Non-programmer here. TIA.<br /><br />Marc<br /> ]]></description>
	</item>

	
	<item>
		<title>Get x,y,z of drawing view vertex/edge</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14689</link> 
		<pubDate>Fri, 05 Sep 2008 09:58:51 EST</pubDate> 
		<dc:creator>Luke Malpass</dc:creator>
   	    <slash:comments>7</slash:comments> 
		<description><![CDATA[ OK it is the simplest thing yet it seems nearly impossible; I am just after the x and y location relative to the drawing sheet of a vertex or an edge from a drawing view. No matter what I try I cannot get any valid result.<br /><br />For example say you have a view of a cube and it is positioned in the middle of a drawing sheet. If you get the bottom left edge vertex of the box and call the Edge::GetStartVertex::GetPoint it returns 0, 0, 0 for example as it is the bottom corner in the model. However, I want that position relative to the drawing sheet, which would be something like 0.15, 0.1, 0 (x,y,z in meters).<br /><br />I have tried using MathUtility to create a point and apply a transform to it using the views ModelToViewTransform and ModelToViewTransform.Inverse, and neither give the correct result. I have tried using the sheet view, the model view, everything.<br /><br />It is a simple enough request that seems impossible to do. Any advice anyone? ]]></description>
	</item>

	
	<item>
		<title>Property Manager Page</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14686</link> 
		<pubDate>Fri, 05 Sep 2008 08:45:35 EST</pubDate> 
		<dc:creator>Lee Priest</dc:creator>
   	    <slash:comments>3</slash:comments> 
		<description><![CDATA[ Does anyone know how to utilize the multiple page option of the property manager page?<br /><br />I've used the swPropertyManagerOptions_MultiplePages option to create the buttons, and I'm aware of the PropertyManagerPage2Handler4_OnNextPage event, but I'm not sure where to go from there.<br /><br />Does each page have to be generated when the user clicks the next button, and if the user goes back to the previous page and it is created again from scratch, wouldn't all the information be lost?<br /><br />Thanks!<br /><br />Lee ]]></description>
	</item>

	
	<item>
		<title>Macros not Appearing in Tools&amp;gt;Customize&amp;gt;Menus-Categories</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14683</link> 
		<pubDate>Fri, 05 Sep 2008 08:00:16 EST</pubDate> 
		<dc:creator>Philip Prendeville</dc:creator>
   	    <slash:comments>6</slash:comments> 
		<description><![CDATA[ Hi all,<br /><br />I've downloaded a few really useful macro files. I want to assign shortcut keys and I'm following the help files:<br /><br />"To assign a macro to a shortcut key:<br /><br />With a document open, click Tools, Customize, Keyboard.<br /><br />Select Macros in Categories.<br /><br /> If Macros is not listed, you must create a macro folder and record a macro in your SolidWorks installation directory, as described in the first procedure".<br /><br />I've created a folder in the data folder in Program Files>SolidWorks.... and copied the macros in here. Macros isn't listed in the categories area though. What next?<br /> ]]></description>
	</item>

	
	<item>
		<title>recognize feature</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14679</link> 
		<pubDate>Fri, 05 Sep 2008 05:18:19 EST</pubDate> 
		<dc:creator>Y I</dc:creator>
   	    <slash:comments>1</slash:comments> 
		<description><![CDATA[ Hello,<br />I am trying to create a feature in SolidWorks model.<br /><br />This feature is already present in the model as a set of faces in imported geometry.<br /><br />I have information about feature type and parameters, such as hole depth, hole diameter, also I know id of faces.<br /><br />Function FeatureWorksApp->recognizeFeatureAutomatic() does not use the information about feature parameters.<br /><br />How can I create this feature in SolidWorks?<br /><br />Best regards.<br />Yuri Ignatiev ]]></description>
	</item>

	
	<item>
		<title>Unable to Select BOM</title>
		<link>https://forum.solidworks.com/forum/messageview.cfm?catid=11&amp;threadid=14661</link> 
		<pubDate>Thu, 04 Sep 2008 10:51:22 EST</pubDate> 
		<dc:creator>Chris King</dc:creator>
   	    <slash:comments>8</slash:comments> 
		<description><![CDATA[ Hi there,<br /><br />I am an MS Office VBA developer who has been tasked to write a custom application that will upload a BOM table in Solidworks to our MRP system.<br /><br />I have been attempting to use the ExportBOM Macro I found at <a target=_blank class=ftalternatingbarlinklarge href="http://forum.angelsix.com/viewtopic.php?f=26&t=16">Angel Six Forums</a> as the basis for selecting the BOM.<br /><br />However, whilst the ExportBOM macro runs it seems unable to detect the BOM in the drawing I am using as a test item.<br /><br />I am fairly sure that the table object I have selected is a BOM (please see attached screenshot) but it isn't being detected.<br /><br />I am completely new to the SW Object Model and would really appreciate any advice on where I am going wrong.<br /><br />Thanks<br /><br />Chris King<br />Guidance Ltd.<br />Leicester <br />UK ]]></description>
	</item>

</channel>
</rss>


