News:

Please remember to do a search before you ask a question!

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Groups?

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

Previous topic - Next topic

0 Members and 0 Guests 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.