Register  Login   Search
 Latest Posts Minimize

RE: Remove unused Linestyles
Solid Edge Programming
09/03/2010 7:45 AM
jr199

Remove unused Linestyles
Solid Edge Programming
09/02/2010 1:25 PM
kmwolf

How to read block in a dft file without opening the dft file?
Solid Edge Programming
09/02/2010 9:02 AM
assassin.007

Inquire Element - Measure Diameter by VBA
Solid Edge Programming
09/02/2010 6:40 AM
JM

dissolve Reference to SubASM - how to??
Solid Edge Programming
09/02/2010 2:23 AM
LIHE

RE: Using Insight on a 64 bit Computer
Solid Edge General
08/31/2010 7:47 AM
Atom

Using Insight on a 64 bit Computer
Solid Edge General
08/30/2010 3:06 PM
Atom

RE: File Properties using VB.NET leave file locked
Solid Edge Programming
08/30/2010 9:57 AM
JBZ

RE: File Properties using VB.NET leave file locked
Solid Edge Programming
08/30/2010 3:20 AM
jr199

File Properties using VB.NET leave file locked
Solid Edge Programming
08/27/2010 4:36 PM
JBZ

RE: XLS link to the part
Solid Edge Programming
08/27/2010 4:11 PM
JBZ

RE: Save As for each view -- how 2 wait for SE !
Solid Edge Programming
08/27/2010 3:27 AM
jr199

vb6 se20 - solid edge Part - Hole size
Solid Edge Programming
08/26/2010 9:42 PM
cadraw

vb6 se20 - how to Drawing View Depth
Solid Edge Programming
08/26/2010 9:24 PM
cadraw

RE: Problem while getting the objects using "SelectSet" property.
Solid Edge Programming
08/26/2010 7:35 AM
jr199

RE: About the "Callout"!
Solid Edge Programming
08/26/2010 3:42 AM
fatkids

RE: Save As for each view -- how 2 wait for SE !
Solid Edge Programming
08/25/2010 3:28 AM
ErWo

RE: help to transfer C# codes as following to C++ codes?
Solid Edge Programming
08/24/2010 10:12 PM
assassin.007

RE: FamilyMembers Panel problem (refreshing)
Solid Edge Programming
08/24/2010 3:47 PM
peter6396

Save As for each view -- how 2 wait for SE !
Solid Edge Programming
08/24/2010 4:09 AM
LIHE

RE: FamilyMembers Panel problem (refreshing)
Solid Edge Programming
08/24/2010 1:28 AM
ErWo

help to transfer C# codes as following to C++ codes?
Solid Edge Programming
08/23/2010 10:34 PM
assassin.007

Problem while getting the objects using "SelectSet" property.
Solid Edge Programming
08/22/2010 7:59 AM
pratap

FamilyMembers Panel problem (refreshing)
Solid Edge Programming
08/20/2010 4:12 AM
peter6396

RE: AddLoftedFlange in SheetMetal
Solid Edge Programming
08/19/2010 4:33 AM
jason.newell

RE: PartList Positioning
Solid Edge Programming
08/19/2010 2:10 AM
ErWo

RE: Alternate Assemblies
Solid Edge Programming
08/18/2010 4:54 PM
peter6396

RE: About the "Callout"!
Solid Edge Programming
08/18/2010 7:39 AM
Danisan

XLS link to the part
Solid Edge Programming
08/18/2010 5:23 AM
romanes

About the "Callout"!
Solid Edge Programming
08/17/2010 2:49 AM
fatkids


  
 Forums Minimize

Subject: Through the program to create a square tube???
Prev Next
You are not authorized to post a reply.

Author Messages
fatkidsUser is Offline
Site Member
Site Member
Posts:46

02/04/2010 12:37 AM  

Hi all!

I need to through the program to create a square tube, Code is as follows:

            SolidEdgeFramework.Application application = null;
            SolidEdgeFramework.Documents documents = null;
            SolidEdgePart.PartDocument part = null;
            SolidEdgePart.ProfileSets profileSets = null;
            SolidEdgePart.ProfileSet profileSet = null;
            SolidEdgePart.Profiles profiles = null;
            SolidEdgePart.Profile profile = null;
            SolidEdgePart.RefPlanes refplanes = null;
            SolidEdgeFrameworkSupport.Relations2d relations2d = null;
            SolidEdgeFrameworkSupport.Relation2d relation2d = null;
            SolidEdgeFrameworkSupport.Lines2d lines2d = null;
            SolidEdgeFrameworkSupport.Line2d line2d = null;
            SolidEdgeFrameworkSupport.Circle2d circle2d = null;
            SolidEdgeFrameworkSupport.Arcs2d arcs = null;
            SolidEdgeFrameworkSupport.Arc2d arc = null;
            SolidEdgePart.Models models = null;
            SolidEdgePart.Model model = null;
            System.Array aProfiles = null;
            try
            {
                // Connect to a running instance of Solid Edge
                application = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
                // Get a reference to the documents collection
                documents = application.Documents;
                // Create a new part document
                part = (SolidEdgePart.PartDocument)documents.Add("SolidEdge.PartDocument", Missing.Value);
                // Get a reference to the profile sets collection
                profileSets = part.ProfileSets;
                // Add a new profile set
                profileSet = profileSets.Add();
                // Get a reference to the profiles collection
                profiles = profileSet.Profiles;
                // Get a reference to the ref planes collection
                refplanes = part.RefPlanes;
                // Add a new profile
                profile = profiles.Add(refplanes.Item(3));
                // Get a reference to the lines2d collection
                lines2d = profile.Lines2d;
                arcs = profile.Arcs2d;
                // Draw the outer Profile
                lines2d.AddBy2Points(0, 0, 0.08, 0);
                lines2d.AddBy2Points(0.08, 0, 0.08, 0.08);
                lines2d.AddBy2Points(0.08, 0.08, 0, 0.08);
                lines2d.AddBy2Points(0, 0.08, 0, 0);

               // Draw the inner Profile
                lines2d.AddBy2Points(0.02, 0.02, 0.06, 0.02);
                lines2d.AddBy2Points(0.06, 0.02, 0.06, 0.06);
                lines2d.AddBy2Points(0.06, 0.06, 0.02, 0.06);
                lines2d.AddBy2Points(0.02, 0.06, 0.02, 0.02);
                
                 // Define Relations among the Line objects to make the Profile closed
                relations2d = (SolidEdgeFrameworkSupport.Relations2d)profile.Relations2d;
                relation2d = relations2d.AddKeypoint(lines2d.Item(1), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(2), (int)KeypointIndexConstants.igLineStart, true);
                relation2d = relations2d.AddKeypoint(lines2d.Item(2), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(3), (int)KeypointIndexConstants.igLineStart, true);
                relation2d = relations2d.AddKeypoint(lines2d.Item(3), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(4), (int)KeypointIndexConstants.igLineStart, true);
                relation2d = relations2d.AddKeypoint(lines2d.Item(4), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(1), (int)KeypointIndexConstants.igLineStart, true);

                relation2d = relations2d.AddKeypoint(lines2d.Item(5), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(6), (int)KeypointIndexConstants.igLineStart, true);
                relation2d = relations2d.AddKeypoint(lines2d.Item(6), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(7), (int)KeypointIndexConstants.igLineStart, true);
                relation2d = relations2d.AddKeypoint(lines2d.Item(7), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(8), (int)KeypointIndexConstants.igLineStart, true);
                relation2d = relations2d.AddKeypoint(lines2d.Item(8), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(5), (int)KeypointIndexConstants.igLineStart, true);
                //relation2d = relations2d.AddKeypoint(lines2d.Item(10), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(11), (int)KeypointIndexConstants.igLineStart, true);
                //relation2d = relations2d.AddKeypoint(lines2d.Item(11), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(12), (int)KeypointIndexConstants.igLineStart, true);
                //relation2d = relations2d.AddKeypoint(lines2d.Item(12), (int)KeypointIndexConstants.igLineEnd, lines2d.Item(1), (int)KeypointIndexConstants.igLineStart, true);
                arcs.AddAsFillet(lines2d.Item(1), lines2d.Item(2), 0.01, -1, 1);
                arcs.AddAsFillet(lines2d.Item(2), lines2d.Item(3), 0.01, -1, -1);
                arcs.AddAsFillet(lines2d.Item(3), lines2d.Item(4), 0.01, 1, -1);
                arcs.AddAsFillet(lines2d.Item(4), lines2d.Item(1), 0.01, 1, 1);

                arcs.AddAsFillet(lines2d.Item(5), lines2d.Item(6), 0.01, -1, 1);
                arcs.AddAsFillet(lines2d.Item(6), lines2d.Item(7), 0.01, -1, -1);
                arcs.AddAsFillet(lines2d.Item(7), lines2d.Item(8), 0.01, 1, -1);
                arcs.AddAsFillet(lines2d.Item(8), lines2d.Item(5), 0.01, 1, 1);


                // Close the profile
                profile.End(SolidEdgePart.ProfileValidationType.igProfileClosed);
                // Hide the profile
                profile.Visible = false;
                // Create a new array of profile objects
                aProfiles = Array.CreateInstance(typeof(SolidEdgePart.Profile), 1);
                aProfiles.SetValue(profile, 0);
                // Get a reference to the models collection
                models = part.Models;
                // Create the extended protrusion.
                model = models.AddFiniteExtrudedProtrusion(aProfiles.Length, ref aProfiles, SolidEdgePart.FeaturePropertyConstants.igRight, 0.05, Missing.Value, Missing.Value, Missing.Value, Missing.Value);

After the program runs, the resulting error message is as follows:

Internal error:Unable to computer topology information for the sketched profile.

Please help!

[script removed]
You are not authorized to post a reply.
Forums > Solid Edge > Programming > Through the program to create a square tube???



ActiveForums 3.7

  

 Users Online Minimize

Membership Membership:
Latest New User Latest: jbazaar
New Today New Today: 1
New Yesterday New Yesterday: 3
User Count Overall: 1968

People Online People Online:
Visitors Visitors: 1
Members Members: 0
Total Total: 1

Online Now Online Now:

  

The Code Project

Spatial Freedom Astroid

Use OpenDNS

Copyright 2010 JasonNewell.NET   Terms Of Use  Privacy Statement