georeference.org
Subscribe to this thread
Home - General / All posts - unlink label by script
martin23 post(s)
#27-Jun-08 00:27

Hi all,

I create labels from a Drawing by vbScript. Later I decompose the Drawing. As a consequence, there are Labels for every branch then. So I have to unlink the label component before decomposing the Drawing but I couldn't find something about to do it by scripting. Does anyone has an idea how to do it?

Thanks in advance for your help and greetings from Martin

adamw


4,662 post(s)
#04-Jul-08 04:46

There is no way to unlink a labels component via a script, but you can create a copy of a linked component:

'VBScript

Sub Main

  Set src = Document.ComponentSet("Labels")

  Set tgt = Document.NewLabels("Unlinked", src.CoordinateSystem)

  For Each lbl In src.LabelSet

    tgt.LabelSet.Add lbl.Text, lbl.Geom

  Next

End Sub

AR_Rick

127 post(s)
#05-Jul-08 13:27

UI scripting won't do this? ... and tsk for working on the fourth :)


Need industrial grade Manifold hosting? Scaling, Load Balancing, Special Tuning, etc. Drop me a line.

tjhb

2,384 post(s)
#05-Jul-08 16:26

Works. Needs to be run in a separate thread, otherwise still succeeds but leads to a series of "unknown error" messages.

Sub Main

    Document.ComponentSet("Labels").Open

    Application.UserInterface.InvokeCommand "LabelsUnlink"

    Application.ActiveWindow.Close

End Sub

martin23 post(s)
#08-Jul-08 01:01

Hi,

thank you very much for your help! The "UI scripting thing" works very fine. There are a lot of more things I can do in the same way now. Great!

Greetings from Martin

0 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.