<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: using VBA to rotate 3d object in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485535#M39015</link>
    <description>I dont think a selectionset has the rotate property. Try ssetObj(0).Rotate3D  or for i=0 to ssetObj.count-1 set Ent=ssetOb(i)</description>
    <pubDate>Sun, 13 Nov 2005 04:26:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-11-13T04:26:30Z</dc:date>
    <item>
      <title>using VBA to rotate 3d object</title>
      <link>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485534#M39014</link>
      <description>Dear sir,&lt;BR /&gt;
I have a drawing of AutoCAD it contains some objects.I want to use rotade3d  in VBA. First I want to select the object from the  drawing and then rotate it.&lt;BR /&gt;
I wrote the code as follows&lt;BR /&gt;
Sub Example_rotate()&lt;BR /&gt;
    ' This example creates a selection set and several objects.&lt;BR /&gt;
    ' It then adds the objects to the selection set, and then&lt;BR /&gt;
    ' rote the objects of selection set.&lt;BR /&gt;
    ThisDrawing.Application.Documents.Open ("d:\cad\test")&lt;BR /&gt;
       ' Create the selection set&lt;BR /&gt;
    Dim ssetObj As AcadSelectionSet&lt;BR /&gt;
    Set ssetObj = ThisDrawing.SelectionSets.Add("SSET")&lt;BR /&gt;
     &lt;BR /&gt;
        ' Add all object to the selection set that lie within a crossing of (0,-1,0) and&lt;BR /&gt;
    ' (14, 1,0)&lt;BR /&gt;
    Dim mode As Integer&lt;BR /&gt;
    Dim corner1(0 To 2) As Double&lt;BR /&gt;
    Dim corner2(0 To 2) As Double&lt;BR /&gt;
      &lt;BR /&gt;
    mode = acSelectionSetCrossing&lt;BR /&gt;
    corner1(0) = 0: corner1(1) = -1: corner1(2) = 0&lt;BR /&gt;
    corner2(0) = 14: corner2(1) = 1: corner2(2) = 0&lt;BR /&gt;
    ssetObj.Select mode, corner1, corner2&lt;BR /&gt;
    &lt;BR /&gt;
    ' Define the rotation axis with two points&lt;BR /&gt;
    Dim rotatePt1(0 To 2) As Double&lt;BR /&gt;
    Dim rotatePt2(0 To 2) As Double&lt;BR /&gt;
    Dim rotateAngle As Double&lt;BR /&gt;
    &lt;BR /&gt;
    rotatePt1(0) = 0: rotatePt1(1) = 0: rotatePt1(2) = 0&lt;BR /&gt;
    rotatePt2(0) = 0: rotatePt2(1) = 0: rotatePt2(2) = 3&lt;BR /&gt;
    rotateAngle = 90&lt;BR /&gt;
    rotateAngle = rotateAngle * 3.141592 / 180#&lt;BR /&gt;
   &lt;BR /&gt;
     ssetObj.Rotate3D rotatePt1, rotatePt2, rotateAngle&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
 Note&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; when I change the last code line &lt;BR /&gt;
From ssetObj.Rotate3D rotatePt1, rotatePt2, rotateAngle&lt;BR /&gt;
To ssetObj.Erase . the erase is done. &lt;BR /&gt;
But in rotation case  I have response tells error in the following code line&lt;BR /&gt;
ssetObj.Rotate3D rotatePt1, rotatePt2, rotateAngle&lt;BR /&gt;
Looking forward to your help&lt;BR /&gt;
Yours &lt;BR /&gt;
Qudeiri</description>
      <pubDate>Sun, 13 Nov 2005 03:32:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485534#M39014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-13T03:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: using VBA to rotate 3d object</title>
      <link>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485535#M39015</link>
      <description>I dont think a selectionset has the rotate property. Try ssetObj(0).Rotate3D  or for i=0 to ssetObj.count-1 set Ent=ssetOb(i)</description>
      <pubDate>Sun, 13 Nov 2005 04:26:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485535#M39015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-13T04:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: using VBA to rotate 3d object</title>
      <link>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485536#M39016</link>
      <description>Deae Bryco &lt;BR /&gt;
Please give me some details about how can I select more then one object from existing drawing. then how I can rotate it.&lt;BR /&gt;
I have error with this for i=0 to ssetObj.count-1 set Ent=ssetOb(i)</description>
      <pubDate>Mon, 14 Nov 2005 03:42:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485536#M39016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-14T03:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: using VBA to rotate 3d object</title>
      <link>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485537#M39017</link>
      <description>Deae Bryco &lt;BR /&gt;
Please give me some details about how can I select more then one object from existing drawing. then how I can rotate it.&lt;BR /&gt;
I have error with this for i=0 to ssetObj.count-1 set Ent=ssetOb(i)   &lt;BR /&gt;
&lt;BR /&gt;
looking forwared to hearing from you &lt;BR /&gt;
yours &lt;BR /&gt;
qudeiri</description>
      <pubDate>Mon, 14 Nov 2005 03:43:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485537#M39017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-14T03:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: using VBA to rotate 3d object</title>
      <link>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485538#M39018</link>
      <description>To cycle through all entities in a selectionset.&lt;BR /&gt;
&lt;BR /&gt;
For Each objEnt in objSSet&lt;BR /&gt;
&lt;BR /&gt;
Next objEnt&lt;BR /&gt;
&lt;BR /&gt;
Regards - Nathan</description>
      <pubDate>Mon, 14 Nov 2005 06:01:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485538#M39018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-14T06:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: using VBA to rotate 3d object</title>
      <link>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485539#M39019</link>
      <description>Either Nathan's or my why will work. You should always have option explicit at the top of the module if your using vba and that will tell you if you forget to dim i as integer. If you have an on error next statement, get rid of it until you have your code running or just get rid of it. Rotating every ent in your selection set is the same as rotating the whole set so you'll get there.</description>
      <pubDate>Mon, 14 Nov 2005 13:51:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/using-vba-to-rotate-3d-object/m-p/1485539#M39019</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-14T13:51:41Z</dc:date>
    </item>
  </channel>
</rss>

