<?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>Thema "Inventor (2018) VBA - Flächen über API heften" in Inventor - Deutsches Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8917271#M14012</link>
    <description>&lt;P&gt;Hallo zusammen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ich würde gerne Volumenkörper aus FLächenkörpern über die API erzeugen und bin schon am Verzweifeln.&lt;/P&gt;&lt;P&gt;Manuell markiere ich den Flächenkörper, führe den Befehl "Heften" aus, bestätige das ganze und schon ist die Geschichte erledigt.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-07-18 16_31_30-Marking Menu.png" style="width: 572px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/658809i56FFB322BB9E2580/image-dimensions/572x197?v=v2" width="572" height="197" role="button" title="2019-07-18 16_31_30-Marking Menu.png" alt="2019-07-18 16_31_30-Marking Menu.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-07-18 16_32_19-Marking Menu.png" style="width: 550px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/658810iA304C3DF1C0B807F/image-dimensions/550x190?v=v2" width="550" height="190" role="button" title="2019-07-18 16_32_19-Marking Menu.png" alt="2019-07-18 16_32_19-Marking Menu.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Das würde ich gerne über VBA ausführen können, damit ich die paar tausend einzelnen Dateien nicht manuell bearbeiten muss.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ich habe einiges ausprobiert, aber nichts scheint zu funktionieren. Hat hier jemand eine Idee?&lt;/P&gt;&lt;P&gt;Übrigens handelt es sich um importierte Dateien.. vielleicht liegt es ja daran?&lt;/P&gt;&lt;PRE&gt;Public Sub Heften()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oSurfaces As ObjectCollection
    Set oSurfaces = ThisApplication.TransientObjects.CreateObjectCollection
    
    Dim oSolidBody As SurfaceBody
    Set oSolidBody = oDoc.ComponentDefinition.WorkSurfaces.Item(1).SurfaceBodies.Item(1)
    
'    Dim oFace As Face
'    Dim oFaces As Faces
'    Set oFaces = oDoc.ComponentDefinition.WorkSurfaces.Item(1).SurfaceBodies.Item(1).Faces
'    For Each oFace In oFaces
'        oSurfaces.Add oFace
'    Next

    oSurfaces.Add oDoc.ComponentDefinition.WorkSurfaces.Item(1)
    Dim oKnitFeature As KnitFeature
    Stop
    Set oKnitFeature = oCompDef.Features.KnitFeatures.Add(oSurfaces)
End Sub&lt;/PRE&gt;&lt;P&gt;Anbei auch eine ipt.&lt;/P&gt;&lt;P&gt;Besten Dank!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gruß,&lt;/P&gt;&lt;P&gt;Aleks&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2019 14:57:09 GMT</pubDate>
    <dc:creator>fullevent</dc:creator>
    <dc:date>2019-07-18T14:57:09Z</dc:date>
    <item>
      <title>Inventor (2018) VBA - Flächen über API heften</title>
      <link>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8917271#M14012</link>
      <description>&lt;P&gt;Hallo zusammen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ich würde gerne Volumenkörper aus FLächenkörpern über die API erzeugen und bin schon am Verzweifeln.&lt;/P&gt;&lt;P&gt;Manuell markiere ich den Flächenkörper, führe den Befehl "Heften" aus, bestätige das ganze und schon ist die Geschichte erledigt.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-07-18 16_31_30-Marking Menu.png" style="width: 572px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/658809i56FFB322BB9E2580/image-dimensions/572x197?v=v2" width="572" height="197" role="button" title="2019-07-18 16_31_30-Marking Menu.png" alt="2019-07-18 16_31_30-Marking Menu.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-07-18 16_32_19-Marking Menu.png" style="width: 550px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/658810iA304C3DF1C0B807F/image-dimensions/550x190?v=v2" width="550" height="190" role="button" title="2019-07-18 16_32_19-Marking Menu.png" alt="2019-07-18 16_32_19-Marking Menu.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Das würde ich gerne über VBA ausführen können, damit ich die paar tausend einzelnen Dateien nicht manuell bearbeiten muss.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ich habe einiges ausprobiert, aber nichts scheint zu funktionieren. Hat hier jemand eine Idee?&lt;/P&gt;&lt;P&gt;Übrigens handelt es sich um importierte Dateien.. vielleicht liegt es ja daran?&lt;/P&gt;&lt;PRE&gt;Public Sub Heften()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oSurfaces As ObjectCollection
    Set oSurfaces = ThisApplication.TransientObjects.CreateObjectCollection
    
    Dim oSolidBody As SurfaceBody
    Set oSolidBody = oDoc.ComponentDefinition.WorkSurfaces.Item(1).SurfaceBodies.Item(1)
    
'    Dim oFace As Face
'    Dim oFaces As Faces
'    Set oFaces = oDoc.ComponentDefinition.WorkSurfaces.Item(1).SurfaceBodies.Item(1).Faces
'    For Each oFace In oFaces
'        oSurfaces.Add oFace
'    Next

    oSurfaces.Add oDoc.ComponentDefinition.WorkSurfaces.Item(1)
    Dim oKnitFeature As KnitFeature
    Stop
    Set oKnitFeature = oCompDef.Features.KnitFeatures.Add(oSurfaces)
End Sub&lt;/PRE&gt;&lt;P&gt;Anbei auch eine ipt.&lt;/P&gt;&lt;P&gt;Besten Dank!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gruß,&lt;/P&gt;&lt;P&gt;Aleks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:57:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8917271#M14012</guid>
      <dc:creator>fullevent</dc:creator>
      <dc:date>2019-07-18T14:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor (2018) VBA - Flächen über API heften</title>
      <link>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8932385#M14013</link>
      <description>&lt;P&gt;Hallo, probier mal etwas ähnliches. Ich stellte fest, dass das Problem darin bestand, eine zusammengesetzte Oberfläche zu nehmen. Das Erfassungsobjekt funktioniert sehr gut, wenn es sich um separate Flächen handelt, nicht um zusammengesetzte Oberflächen. Wenn in Ihrem Beispiel alle Gesichter getrennt wären, sollte es meines Erachtens keinen Fehler geben.&lt;BR /&gt;Ich habe ein Modell mit einer Logik angehängt, die es schafft, die Aufgabe auszuführen, wenn es sich um separate Oberflächen handelt.&lt;/P&gt;&lt;P&gt;Dieser Fehler sollte nicht existieren, ich denke es könnte eine Einschränkung sein. Um das zu erreichen, wonach ich gesucht habe, wählen Sie einen alternativen Weg.&lt;BR /&gt;Ich denke, Sie könnten den Befehlsmanager und die Anweisung "AppStitchWrapperCmd" ausprobieren, indem Sie sie in Ihren Programmzeilen kombinieren. Ich versuche immer, solche Anweisungen zu vermeiden, weil sie mir normalerweise Kopfschmerzen bereiten. Wie auch immer, Sie sind sehr weise, wo ich versagt habe, ich bin sicher, Sie können den Fehler überwinden. Also warte ich auf das, was du entdeckst und das du teilen kannst. Ich sende Ihnen meine besten Grüße&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 10:22:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8932385#M14013</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-07-26T10:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor (2018) VBA - Flächen über API heften</title>
      <link>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935829#M14014</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4253164"&gt;@Sergio.D.Suárez&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;vielen Dank für deine Antwort und den Tipp mit dem Befehlsmanager.&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;Aktuell komme ich bis zu dem folgenden Fenster. Dieses müsste ich nun irgendwie mit "Anwenden" bestätigen.&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;Hast du eine Idee wie das via VBA umzusetzen ist?&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;Den Weg über die einzelnen Flächen werde ich noch ausprobieren. Sieht aber vielversprechend aus. Danke für den Tipp!&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---------------ÜBERSETZUNG/TRANSLATION-----------------&lt;/P&gt;
&lt;P&gt;thank you very much for your answer and the tip with the command manager.&lt;BR /&gt;At the moment I can reach the following window. Now I would have to confirm this somehow with "Apply".&lt;BR /&gt;Do you have any idea how to do this via VBA?&lt;/P&gt;
&lt;P&gt;I will try out the way over the single surfaces. But it looks promising. Thanks for the tip!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-07-29 11_46_48-Window.png" style="width: 397px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/661976i179AA82E48B9DDAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-07-29 11_46_48-Window.png" alt="2019-07-29 11_46_48-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Greetings&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5056650"&gt;@fullevent&lt;/a&gt;&amp;nbsp;Textreihenfolge wurde von&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4103024"&gt;@michele.mk&lt;/a&gt;&amp;nbsp;geändert um Deutsch hervorzuheben, da deutsches Forum.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 11:33:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935829#M14014</guid>
      <dc:creator>fullevent</dc:creator>
      <dc:date>2019-07-29T11:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor (2018) VBA - Flächen über API heften</title>
      <link>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935893#M14015</link>
      <description>&lt;P&gt;-------------------------------------ÜBERSETZUNG-----------------------------&lt;/P&gt;
&lt;P&gt;In der angehängten Datei finden Sie Informationen, die hilfreich sein könnten. Nach vielen Tests hatte er es einmal geschafft, aber dieser "cmd" -Pfad verursacht oft Kopfschmerzen. Probleme treten normalerweise auf, wenn Schleifen mit diesen Anweisungen verwendet werden. Manchmal gibt "Execute2 (True)" nicht die erwarteten Ergebnisse zurück. Ich habe jedoch viele Ihrer Arbeiten gesehen und sie sind sehr interessant. Ich denke, Sie könnten eine bessere Lösung finden als das, was ich erreichen könnte, und vielleicht können Sie das Problem besser lösen. : smileywink: Grüße&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;------------------------------ORIGINAL---------------------------------------&lt;/P&gt;
&lt;P&gt;In the attached file you have information that could be useful. Once, after many tests he had been able to achieve it, but this "cmd" path often causes headaches. Problems usually occur when loops are used with these instructions, sometimes "Execute2 (True)" does not return the expected results. However, I have seen many of your work and they are very interesting, I think you could find a better solution than what I could achieve and maybe you can kill the problem better.&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley (zwinkernd)" title="Smiley (zwinkernd)" /&gt;&amp;nbsp; regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AppContextual_ApplyCmd&lt;/P&gt;
&lt;P&gt;AppContextual_BackCmd&lt;/P&gt;
&lt;P&gt;AppContextual_CancelCmd&lt;/P&gt;
&lt;P&gt;AppContextual_ContinueCmd&lt;/P&gt;
&lt;P&gt;AppContextual_CreateCmd&lt;/P&gt;
&lt;P&gt;AppContextual_DoneCmd&lt;/P&gt;
&lt;P&gt;AppContextual_OKCmd&lt;/P&gt;
&lt;P&gt;AppContextual_RemoveCmd&lt;/P&gt;
&lt;P&gt;AppContextual_RestartCmd&lt;/P&gt;
&lt;P&gt;AppContinueCmd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4253164"&gt;@Sergio.D.Suárez&lt;/a&gt;&amp;nbsp;Text wurde&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4103024"&gt;@michele.mk&lt;/a&gt;&amp;nbsp;überetzt, da es sich im deutschen Forum befindet.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 11:41:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935893#M14015</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-07-29T11:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor (2018) VBA - Flächen über API heften</title>
      <link>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935955#M14016</link>
      <description>&lt;P&gt;&lt;FONT color="#808080"&gt;Vielen Dank.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Soweit funktioniert der code für ein Teil. Ich teste es später mal in einer Schleife.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;Generell erhalten wir eigentlich immer eine Step. Ich werde später mal versuchen das "Problem" weiter vorne anzupacken. Also noch vor dem Import-Vorgang.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Dann bestimmt nicht mehr der User die Import-Einstellungen sondern dieser wird im Code vorgegeben.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;Ich werde die Woche mal rum probieren und mich melden wenn ich etwas vorzeigen kann.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub RunAppStitchWrapperCmd()
    Dim oCommandMgr As CommandManager
    Set oCommandMgr = ThisApplication.CommandManager
    
    Dim oSelect As SelectSet
    Set oSelect = ThisApplication.ActiveDocument.SelectSet
    Call oSelect.Clear
    Call oSelect.Select(ThisApplication.ActiveDocument.ComponentDefinition.WorkSurfaces.Item(1).SurfaceBodies.Item(1))
    
    Dim oControlDef As ControlDefinition
    Set oControlDef = oCommandMgr.ControlDefinitions.Item("AppStitchWrapperCmd")
    Dim oControlDef_A As ControlDefinition
    Set oControlDef_A = oCommandMgr.ControlDefinitions.Item("AppContextual_ApplyCmd")
    Dim oControlDef_D As ControlDefinition
    Set oControlDef_D = oCommandMgr.ControlDefinitions.Item("AppContextual_DoneCmd")

    Call oControlDef.Execute
    Call oControlDef_A.Execute
    Call oControlDef_D.Execute
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---------------ÜBERSETZUNG/TRANSLATION-----------------&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;BR /&gt;So far the code for one part works. I'll test it later in a loop.&lt;/P&gt;
&lt;P&gt;In general we always get a step. I will try to handle the "problem" a little bit earlier. So even before the import process.&lt;BR /&gt;Then the user doesn't determine the import settings anymore, but instead it's set in the code.&lt;/P&gt;
&lt;P&gt;I will try out this week and report when I can demonstrate something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;salute&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5056650"&gt;@fullevent&lt;/a&gt;&amp;nbsp; Textreihenfolge wurde von&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4103024"&gt;@michele.mk&lt;/a&gt;&amp;nbsp; geändert um Deutsch hervorzuheben, da deutsches Forum.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 Jul 2019 11:47:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935955#M14016</guid>
      <dc:creator>fullevent</dc:creator>
      <dc:date>2019-07-29T11:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor (2018) VBA - Flächen über API heften</title>
      <link>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935978#M14017</link>
      <description>&lt;P&gt;Großartig! Es funktioniert super&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 11:35:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-deutsches-forum/inventor-2018-vba-flachen-uber-api-heften/m-p/8935978#M14017</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-07-29T11:35:54Z</dc:date>
    </item>
  </channel>
</rss>

