Re: New tool to IntelliCAD : Create Construct Entities

#17
Run-time error '429)

activex component can't create objet

This is what Chat gpt gave me :

Sub CreateLayer_FTE()

Dim icadApp As Object (this is the line in yellow) - like the error is here !!!
Dim icadDoc As Object
Dim lay As Object

Set icadApp = GetObject(, "IntelliCAD.Application")
Set icadDoc = icadApp.ActiveDocument

' Check if layer already exists
On Error Resume Next
Set lay = icadDoc.Layers.Item("FTE")
On Error GoTo 0

' If not, create it
If lay Is Nothing Then
Set lay = icadDoc.Layers.Add("FTE")
End If

' Set layer properties
lay.color = 30 ' ACI color 30
lay.Linetype = "Continuous"
lay.Lineweight = 25 ' 0.25 mm (optional)
lay.Plottable = True

icadDoc.ActiveLayer = lay

MsgBox "Layer FTE ready"

End Sub

Re: New tool to IntelliCAD : Create Construct Entities

#19
Hi Martin,

I created a new toolbar ( L6_FTE ) then added a new tool (L6)
In the new tool, under command name I added
^C^C^C-layer;M;FTE;C;30;;;;

This works, in that it creates the new layer FTE, set the colour to 30 and then sets layer FTE to be the active layer.

There are 3 cancels (^C) as if you are in dimensions when you select the tool you could be 3 levels into the dimension command.
Plus a couple of ecxtra 'enters' to close the command.
Last edited by sln8458 on Wed Feb 25, 2026 11:34 am, edited 1 time in total.
CMS Intellicad 14.1.411.168739.PE+.VC17.x64.CMS141
i9-12900k / 64gb-3200 - NVIDIA GeForce TRX 3060 Ti 8Gb Windows 11 Pro
Steve Nichols
Attachments
L6.png
L6.png (78 KiB) Viewed 2154 times

Re: New tool to IntelliCAD : Create Construct Entities

#20
Here's another option:
In CUI add a keyboard shortcut ( ALT+L )
open the new shortcut
Then under Command Name add

Code: Select all

 ^-(command "-layer" "m" "FTE" "C" "30" "" "")
alt+l.png
alt+l.png (61.73 KiB) Viewed 2133 times
This does not contain the cancels ^C, I would add them if there is a chance of using this macro when another command is active.
CMS Intellicad 14.1.411.168739.PE+.VC17.x64.CMS141
i9-12900k / 64gb-3200 - NVIDIA GeForce TRX 3060 Ti 8Gb Windows 11 Pro
Steve Nichols