News:

When replying to a specific statement be sure to quote the previous post.

Main Menu

Groups?

Started by Brooks, June 09, 2009, 11:36:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brooks

Hi--Have just recently started trying to sort out how to customize TC with a few programs of my own.   Currently I am working on a html/vbscript that runs in the Internet Palette, reads a file and plots a set of oriented symbols based on the file data (x, y, z, bearing). 

The symbol has severa lines and I would like to link them into a group after I draw them.   My problem is that I can't figure out how to do that.  I see methods for creating blocks and exploding groups, but not creating groups.  What am I missing?

Any help greatly appreciated.

kchapman

A very good question, Brooks. I'll try to find the answer for you!

Kevan

kchapman

#2
Here's one way: Select the objects that you want to group, then use the AddGroup method of the Selection object.

ex.
----------------------------------------------
'MakeAGroup.vbs'
option explicit
Dim TCApp
Dim TCDraw
Dim TCGraphics
Dim TCGroupGraphic
Dim TCSel
Dim TempGraphic

On Error Resume Next
Set TCApp = CreateObject("TurboCAD.Application")
TCApp.Visible = True
Set TCDraw = TCApp.Drawings.Add("")
Set TCGraphics = TCDraw.Graphics
Dim TCGraphic
Set TCGraphic = TCGraphics.AddCircleCenterAndPoint (0, 0, 0, 2, 0, 0)
TCGraphic.Selected = True
Set TCGraphic = TCGraphics.AddLineSingle (-2, 0, 0, 2, 0, 0)
TCGraphic.Selected = True
Set TCGraphic = TCGraphics.AddLineSingle (0, 0, 0, 0, 2, 0)
TCGraphic.Selected = True
Set TCSel = TCDraw.Selection
Set TCGroupGraphic = TCSel.AddGroup("NewGroup")
------------------------------------------------------------------


Brooks

Thanks! I will give that a try and report back.  Appreciate the speedy response!

Brooks

Thanks Kevan--your code got me through my problem.  If you are interested I have posted the utility that I was working on to the Contributions forum.