Curve handling

All topics about specific development with COM interface, LIP language, API in VB, ...

Moderators: remi77, jacs, Daniel

gvdvenis
Private First Class
Private First Class
Posts: 16
Joined: Thu Apr 12, 2007 10:36 am
TopSolid Module: TopSolid'Design
TopSolid Version: 6.26
Location: Zutphen
Contact:

Curve handling

Unread post by gvdvenis »

Hi, i'd like to know why the following code doesn't work.

Code: Select all

            
Dim topdoc As TopSolid.DocumentDesign = TopApp.ActiveDocument
For Each topCurve As TopSolid.Curve In topdoc.Curves
  If topCurve.Element.NameOrIdentifier = "@636" Then
    topCurve.MakeRefDirection.ReverseDirection()
    Exit For
  End If
Next
First i need to fetch a specific curve from the document. There is a function called SearchElementByName in the IDocument interface, but this returns ONLY named elements, so passing the value "@123" to it doesn't return any values. Hence the stupid FOR EACH loop. It would be nice to be able to search for elements on their identifier, but afaik there isn't such a function. Please prove me wrong on this...

Second Somehow the ReverseDirectioin() function doesn't work. Although i do get a reference to the curve, the ReverseDirection has no effect. What am i doing wrong here? Anybody any ideas? I'm kind of stuck here!

I'm using VisualStudio 2008 on a Vista computer b.t.w. in case this is some kind of weird compatibility issue...
hobby's are for amateurs
paul-ince
Private First Class
Private First Class
Posts: 11
Joined: Thu Dec 18, 2008 12:15 pm
Location: Marche

Unread post by paul-ince »

Hi!

To select an item with its ID you can refer to it in this way:

topdoc.Elements.Item("@636")....


"Somehow the ReverseDirectioin() function doesn't work. Although i do get a reference to the curve, the ReverseDirection has no effect. What am i doing wrong here? Anybody any ideas?"

It's true.. It doesn't work!!!
I'll keep tryng!!
Post Reply