<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
  <channel>
    <title>CATBlog - Catia V5 blog</title>
    <link>http://2htts.com/CATBlog/</link>
    <description>Open forum for Catia V5 knowledge.  Membership required to contribute, but not to browse.</description>
    <!-- optional tags -->
    <language>en-us</language>           <!-- valid langugae goes here -->
    <generator>Nucleus CMS v3.2</generator>
    <copyright>©</copyright>             <!-- Copyright notice -->
    <category>Weblog</category>
    <docs>http://backend.userland.com/rss</docs>
    <image>
      <url>http://2htts.com/CATBlog//nucleus/nucleus2.gif</url>
      <title>CATBlog - Catia V5 blog</title>
      <link>http://2htts.com/CATBlog/</link>
    </image>
    <item>
 <title><![CDATA[CATIA Portable Script Center]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=55</link>
<description><![CDATA[Attached there is a  with few code samples. Hope it will be helpful for those who wants to see and learn something about CATIA programming. Enjoy.]]></description>
 <category>Developer's corner</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=55</comments>
 <pubDate>Mon, 17 Aug 2009 20:12:17 -0400</pubDate>
</item><item>
 <title><![CDATA[CATVBA - Delete All Inactive Operations and Empty Part Bodies]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=49</link>
<description><![CDATA[Running this macro will clean up all Part Bodies in the current model.  This is a VBA format, but could possibly be rewritten as a CATScript.  Error handling has been kept to a minimum, but can be added as required by the user.  There is no user selection required. Application summary: (Module "DelAllUnusedBodies")<br />
<br />
<strong> Nested Loop </strong><br />
1) Count all Bodies in the current part and return the item index<br />
2) Use index to establish loop (for all Bodies in current part)<br />
3) Set current Body to index item<br />
4) Count all HybridShapes in current PartBody and return index<br />
5) Use HybridShapes index to establish loop (for all HybridShapes in current PartBody)<br />
6) Test all HybridShapes for inactivity - if "True", add to collection<br />
7) End HybridShapes loop; End Current Bodyloop.<br />
<strong> / Nested Loop  </strong><br />
<br />
8) Count items in Collection and return the item index<br />
9) Use index to establish loop (for all items in collection)<br />
10) Delete all items in collection; end loop<br />
11) Count all remaining Bodies in current Part and return the item index<br />
12) Use remaining Bodies index to establish loop (for all remaining Bodies)<br />
13) Test all remaining Bodies for HybridShapes count<br />
14) Add all Bodies with no HybridShapes to collection; end loop<br />
15) Count all items in collection and return the item index<br />
16) Use index to establish loop (for all items in collection)<br />
17) Delete all items in collection; end loop<br />
<br />
The module titled "DelUnusedBodies" is similar to "DelAllUnusedBodies", except that it omits a count of all Bodies in the current part, and searches only for inactive operations within "PartBody".  This may be modified, but "DelAllUnusedBodies" will work for either situation, and is the preferred method.<br />
<br />
<br />
<strong>To download, right click the link below, and select "Save Link As...."</strong><br />
<br />
<br />
<br>]]></description>
 <category>Developer's corner</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=49</comments>
 <pubDate>Wed, 08 Apr 2009 00:48:07 -0400</pubDate>
</item><item>
 <title><![CDATA[Law and Sweep: Flexible Corrugated Hose]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=41</link>
<description><![CDATA[I've put this together in response to a recent request for information on modelling a flexible hose (pictured in ENG-TIPS Thread 560-176891), so here's a step-by-step guide to the the method I used, but while I'm at it I'll elaborate a little.<br />
<br />
There's no shortage of pictures so most of them appear as thumbnails, <strong>C L I C K</strong>  on these to open them up in another window.<br />
<img src="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_04_GA.jpg"><br />
<center><strong>(1)</strong></center><br />
<center><br />
<h2> Flexible Corrugated Hose in V5</h2><br />
</center><br />
This simplistic model <strong>(1)</strong> is suitable for modelling one of a pair of top radiator hoses using <i>Law and Sweep</i>  tools, it's also is an opportunity to demonstrate the use of <i>Combine Curve</i>  to construct the guide curve for the (left) hose. Let's assume that the path of the hose centreline is known in plan and side elevation (shown in yellow), as on a drawing, then using the <i>Combine Curve</i>  tool in default <i>Normal</i> mode <strong>(2)</strong> the (blue) resultant curve is made. The two known planar curves are components of a space curve - the transparent ruled surfaces show how the solution is the intersection of two implicit surfaces. Of course, a similar result could have been achieved directly with a spline but the orthogonal component approach is worth mentioning.  <br />
<center><br />
<strong>(2)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_02.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_02.jpg"></a> <strong>(3)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_03.jpg" target=" blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_03.jpg"></a> <strong>(4)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_06.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_06.jpg"></a ><br />
</center><br />
To define the flexible hose corrugations a helix (green) is made along an axis line; the diameter of the helix will be the amplitude, or depth, of the corrugations, while the number of turns and the ratio of pitch to axis length are important, the axis length does not have to the same as the hose guide curve. This is because the <i>Law</i>  will apply itself to the length of the object curve - whatever that may be. Nothing has to be spot-on first time as it can all be altered later.<br />
<br />
In this example a helix is used because the law is going to be sinusoidal. The form of the corrugations can be whatever the user fancies - as at this stage we are actually drawing a graph of the corrugations. To get a graph from the 3D helix, it is <i>normally</i>   projected onto a plane - somewhere out of the way (beside the right cylinder head will do), and a line positioned underneath the projected curve. The distance between them defines the overall diameter of the hose <strong>(3)</strong>.<br />
<center><br />
<strong>(5)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_07_X480.jpg" target=" blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_07_X480.jpg"></a> <strong>(6)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_16_X480.jpg" target=" blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_16_X480.jpg"></a> <strong>(7)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_09.jpg" target=" blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_09.jpg"></a><br />
</center><br />
Open the <i>Law</i> tool <strong>(4)</strong>: the Reference is the red line under the projected curve, and the Definition is the curve itself. The Scale is 0.2 only because I've made the law graph 5 times actual size so that I can see what I'm doing. The new Law has now appeared on the bottom of the Tree.<br />
<br />
Now open the <i>Sweep</i> tool <strong>(5)</strong> and find the Centre and Radius option; select the Centre Curve, ignore the radius, and select Law. This action opens up another box: select the <i>Advanced</i>  option and the click on the Law stored in the Specification tree <strong>(6)</strong>.  <br />
<br />
OK it, and that's it, the corrugated surface is mapped onto the centre (guide) curve <strong>(7)</strong> .<br />
<center><br />
<strong>---------------------o0o---------------------</strong><br />
</center><br />
Another interesting Law-Sweep combination is when there is no obvious way way of constructing a particular curve. A curve that may be seen everyday - and not noticed; a simple, coiled air hose, like those between a truck and a semi-trailer <strong>(8)</strong>.<br />
<br />
How to model one in Catia V5 with the <i>Helix Curve</i> tool isn't immediately obvious (in R14 anyway), as the axis has to be linear. But, in <i>Sweep</i>, a helical surface can be wound along a curve, it's outer boundary saved, and the surface hidden. <br />
<br />
<center><strong>(8)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_19_X480.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_19_X480.jpg"></a> <strong> (9)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_10_X480.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_10_X480.jpg"></a> <strong>(10)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_11_X480.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_11_X480.jpg"></a></center><br />
Open the <i>Sweep</i>  tool and find the <i>With Reference Surface</i>  option <strong>(9)</strong>. There are two versions of this; one uses an existing profile (line or curve), while the second uses an implicit line, which is normal to the axis. You just enter the length of it. The guide curve, in this case, is the conic; the reference surface is something to start the angle of twist from.<br />
<br />
Disregard the <i>Angle</i> and select <i>Law</i>, then select <i>Linear</i>.  The <i>Start value</i> remains at 0, the <i>End value</i> <strong>(10)</strong> defines how many turns the helix will have - I'd start at 360 degrees and see if it's going to work <strong>(11)</strong> . Then edit the law to give the number of turns required. You don't have do any sums to find out how many degrees there are in so many turns - just enter "360*n" (number of turns) - it'll work it out <strong>(12)</strong>.<br />
<br />
In fact, any of it can be altered later - I tend to get something like this functioning first, and then fine tune it.<br />
<br />
The implicit edge of the sweep can be used dirctly as a guide curve for the other sweep, but I prefer to use the <i>Boundary</i> - I think it's better practice...<br />
<center><br />
<strong>(11)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_17_X480.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_17_X480.jpg"></a> <strong>(12)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_18_X480.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_18_X480.jpg"></a> <strong>(13)</strong> <a href="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_14_X480.jpg" target="blank"><img src="http://i22.photobucket.com/albums/b322/GeeVor/th_FlexHose_14_X480.jpg"></a><br />
</center><br />
In the last picture a black helical curve has been wound along a green parabolic conic, and a circular sectioned, helical corrugated surface formed on that <strong>(14)</strong> - a Case of Law on Law...<br />
<br />
I doubt if the need to model hoses, etc is likely to happen very often; this is all about a modelling method and practice: these are a few of many examples of Laws controlling Surfaces. <br />
<center><br />
<strong>(14)</strong> <br />
<img src="http://i22.photobucket.com/albums/b322/GeeVor/FlexHose_20_X480.jpg"><br />
</center><br />
<br />
<center><br />
<font color="#FFFFFF"><br />
<strong>-----------o<font color="#000000">0</font color>o-----------</strong><br />
</font color><br />
</center><br />
]]></description>
 <category>Member articles</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=41</comments>
 <pubDate>Thu, 19 Jul 2007 03:42:07 -0400</pubDate>
</item><item>
 <title><![CDATA[Parameters&DT_with_macro]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=38</link>
<description><![CDATA[Hi,<br />
<br />
This is a small tutorial showing how to work with Design Tables and create parameter.<br />
<br />
All necessary file are <b></b><br />
<br />
Regards<br />
<br />
Fernando]]></description>
 <category>Tips and Tricks</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=38</comments>
 <pubDate>Wed, 14 Mar 2007 17:31:47 -0400</pubDate>
</item><item>
 <title><![CDATA[3D TEXT (works in UNIX and Windows)]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=34</link>
<description><![CDATA[-open a new CATDrawing document<br />
-write with text command what ever you want<br />
-modify text properties if necessary (bold, font, size, a.s.o.)<br />
-run the CATScript  .<br />
-this CATSCript will open also one of the DS CATScripts which you can... ... find it in their on line documentation (I've also attached here a copy - <br />
 ...)<br />
-in the new CATPart opened by DS CATScript choose a plane for your new sketch<br />
-right click on mouse and paste (the text is already selected in dwg file in first CATScript)<br />
-don't forget to "clean" the CATPart for unwanted elements (when you paste, a sketch with the name Main View will be also created but there is no problem to delete it).<br />
-take a look in the TXT2SKETCH.CATScript to see which are the paths for CATScripts and dwg file created by the TXT2SKETCH.CATScript.<br />
<br />
I know that the final "look" its not so nice, but this is because of the polylines which are coming from conversion of the first CATDrawing to dwg file. <br />
<br />
If you want something much nice, you have to explode the polylines in sketch and improve the previous result.<br />
]]></description>
 <category>Developer's corner</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=34</comments>
 <pubDate>Sun, 29 Oct 2006 10:39:55 -0500</pubDate>
</item><item>
 <title><![CDATA[Modifying view scale (UNIX)]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=33</link>
<description><![CDATA[<div style="text-align: left">A CATScript which will modify views scale. The macro will skip the views which are not created and will do the job in the order specified in the message box. <br />
<br />
Sub CATMain()<br />
<br />
MsgBox "First 2 inputs are for Main View Scale and Background View Scale: Even if you will modify these 2      scales, you will not notice any modifications, that's why implicit value is 1. 1st value is for Main,           2nd for Background, 3rd for Front, 4th for Top, 5th for Up, 6th for Left, 7th for Right, 8th for ISO. Use only double value, do NOT use 1:2 or 1/2  (for example)" <br />
<br />
Dim theDrawing As DrawingDocument<br />
Set theDrawing = CATIA.ActiveDocument<br />
Dim aSheet As DrawingSheet<br />
Dim aView As DrawingView<br />
Dim i As Integer, j As Integer<br />
<br />
For i = 1 To theDrawing.Sheets.count<br />
Set aSheet = theDrawing.Sheets.Item(i)<br />
For j = 1 To aSheet.Views.count<br />
Set aView = aSheet.Views.Item(j)<br />
<br />
    ' Retrieve the drawing components collection of the target drawing view<br />
    Dim o2DComponents As DrawingComponents<br />
    Set o2DComponents = aView.Components<br />
<br />
<div style="text-align: left"></div>'Gets the View Scale; <br />
<br />
	aView.Scale = InputBox("Enter drawing scale", "scale", "1")<br />
If aView.Scale = "" Then<br />
MsgBox "The Macro has been aborted."<br />
Exit Sub<br />
End If<br />
<br />
Next<br />
Next<br />
<br />
End Sub</div><br />
]]></description>
 <category>Developer's corner</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=33</comments>
 <pubDate>Wed, 18 Oct 2006 17:26:25 -0400</pubDate>
</item><item>
 <title><![CDATA[Shell vs thicken]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=32</link>
<description><![CDATA[Here is a link which gives the difference b/w shell and thicken surface.<br />
<br />
The Engineer has explained it beautifully<br />
<br />
http://www.coe.org/client_files/events/Shell_vs_Thicken.ppt.<br />
<br />
]]></description>
 <category>Tips and Tricks</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=32</comments>
 <pubDate>Wed, 18 Oct 2006 03:53:15 -0400</pubDate>
</item><item>
 <title><![CDATA[CATPart to STP (UNIX)]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=29</link>
<description><![CDATA[Same batch convert but here is the UNIX version<br />
<br />
Language="VBSCRIPT"<br />
Sub CATMain()<br />
folderinput = InputBox ("Take your files from here","Input","/home/tempin/",2000,4000)folderoutput = InputBox ("Put your files here","Output","/home/tempout/",2000,4000)<br />
<br />
Dim fs, f, f1, fc, s As FileSystemSet fs = CATIA.FileSystemSet f = fs.GetFolder(folderinput)Set fc = f.Files<br />
For Each f1 in fc<br />
Dim PartDocument1 'As DocumentSet documents1 = CATIA.DocumentsDim document1 'As Document<br />
INTRARE = folderinput & f1.nameSet PartDocument1 = CATIA.Documents.Open(INTRARE)<br />
IESIRE = folderoutput & f1.name & ".stp"PartDocument1.ExportData IESIRE, "stp"<br />
<br />
s = s & f1.names = s & vbCrLf<br />
CATIA.ActiveDocument.Close<br />
Next<br />
End Sub<br />
]]></description>
 <category>Developer's corner</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=29</comments>
 <pubDate>Mon, 31 Jul 2006 17:08:38 -0400</pubDate>
</item><item>
 <title><![CDATA[CATPart to STP (Windows)]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=28</link>
<description><![CDATA[A batch convert CATScript<br />
Language="VBSCRIPT"<br />
Sub CATMain()<br />
folderinput = InputBox ("Take your files from here","Input","C:\tempin\",2000,4000)folderoutput = InputBox ("Put your files here","Output","C:\tempout\",2000,4000)<br />
<br />
Dim fs, f, f1, fc, sSet fs = CreateObject("Scripting.FileSystemObject")Set f = fs.GetFolder(folderinput)Set fc = f.Files<br />
For Each f1 in fc<br />
Dim PartDocument1 'As DocumentSet documents1 = CATIA.DocumentsDim document1 'As Document<br />
INTRARE = folderinput & f1.nameSet PartDocument1 = CATIA.Documents.Open(INTRARE)<br />
IESIRE = folderoutput & f1.name & ".stp"PartDocument1.ExportData IESIRE, "stp"<br />
<br />
s = s & f1.names = s & vbCrLf<br />
CATIA.ActiveDocument.Close<br />
Next<br />
End Sub<br />
<br />
Regards<br />
]]></description>
 <category>Developer's corner</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=28</comments>
 <pubDate>Mon, 31 Jul 2006 17:06:25 -0400</pubDate>
</item><item>
 <title><![CDATA[Change line type and width]]></title>
 <link>http://2htts.com/CATBlog/index.php?itemid=27</link>
<description><![CDATA[A small code to change line type and width.<br />
Language="VBSCRIPT"<br />
<br />
Sub CATMain()<br />
<br />
Dim drawingDocument1 As DocumentSet drawingDocument1 = CATIA.ActiveDocument<br />
<br />
'-------------- select generated items<br />
Dim selection4 As SelectionSet selection4 = drawingDocument1.Selection<br />
selection4.Search "CATDrwSearch.CATEarlyGenItem,all"<br />
<br />
Set visProperties1 = CATIA.ActiveDocument.Selection.VisPropertiesvisProperties1.SetRealLineType 1,0.2 '-----------change line type<br />
<br />
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties visProperties1.SetRealWidth 1,0.2 '-----------change width<br />
<br />
End Sub<br />
<br />
<br />
Regards<br />
<br />
Fernando]]></description>
 <category>Developer's corner</category>
<comments>http://2htts.com/CATBlog/index.php?itemid=27</comments>
 <pubDate>Sat, 08 Jul 2006 17:03:13 -0400</pubDate>
</item>
  </channel>
</rss>