We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Light object

Anonymous
Not applicable
I've made a 2D light symbol and saved it has an object.
Changed it's subtype to light.
Works fine except I'd like to get rid of (or bring in closer) the outer
4 bounding points shown in the attachment.
I've searched though the 2D script but don't see any obvious place to
adjust this.
Any hints appreciated.
Thanks
2D script
!
! Name : Light High Eff.gsm
! Date : Saturday, November 24, 2012
! Version : 16.00
! Written by ArchiCAD
!

mul2 A/0.442067, B/0.442067
add2 -73'-1.4267", -31'-0.5917"
pen penAttribute_1
hotspot2 74'-3.3062", 31'-9.2938"
hotspot2 73'-10.1289", 32'-2.4711"
hotspot2 73'-4.9516", 31'-9.2938"
hotspot2 73'-10.1289", 31'-4.1165"
pen penAttribute_2
line_property 0
line2 74'-3.3062", 31'-9.2938", 74'-6.8310", 31'-9.2938"
line2 73'-10.1289", 31'-4.1165", 73'-10.1289", 31'-0.5917"
line2 73'-4.9516", 31'-9.2938", 73'-1.4267", 31'-9.2938"
line2 73'-10.1289", 32'-2.4711", 73'-10.1289", 32'-5.9959"
circle2 73'-10.1289", 31'-9.2938", 0'-5.1773"
pen penAttribute_3
fill fillAttribute_1
poly2_b{5} 5, 2, 0, 3, penAttribute_3, penAttribute_3,
0'-0.0000", 0'-0.0000", 3'-3.3701", 0'-0.0000", 0'-0.0000", 3'-3.3701", 0'-0.0000",
73'-7.2199", 31'-7.5080", 1,
74'-1.6199", 31'-7.5080", 1,
74'-1.6199", 31'-11.1747", 1,
73'-7.2199", 31'-11.1747", 1,
73'-7.2199", 31'-7.5080", 1
define style{2} "AC_STYLE_1" "Arial", 5'-9.4444", 0

paragraph "AC_PRG_2" 4, 0'-0.0000", 0'-0.0000", 0'-0.0000", 2'-3.5591"
pen penAttribute_4
set style "AC_STYLE_1"
"H-EF"
endparagraph
textblock "AC_TEXTBLOCK_2" 0'-0.0000", 9, 0'-0.0000", 1'-11.6220", 3'-3.3701", 3'-3.3701",
"AC_PRG_2"
richtext2 74'-1.6199", 31'-7.5080", "AC_TEXTBLOCK_2"

MyLightObject-16.png
12 REPLIES 12
Anonymous
Not applicable
David wrote:
lec:

If the wires are generated by the Cadimage Add-On, then you will need to contact them or look into the scripts of their objects to see how this is handled.

David
Hi David
Thanks for the response.
I do plan to inquire at C.I. today, but the light objects that connect properly are stock AC's, not Caddimage's so I'm betting it's got to be something in the way stock AC lights are coded vs the one I had AC Save Selection as... Object... subtype light, which don't.
I'll post back C.I.'s take on it.
Anonymous
Not applicable
Here's the solution sent to me by Andrew Watson from Cadimage, which worked perfectly.
I just want to say how nice this new Electrical tool from Cadimage works not only with the stock AC lights, but now also with the simple 2D ones that AC can make on the fly, and made even better with the simple modification below.

"The wiring symbol will link to the origin of your object's 2D symbol.
You can visually see where this is by adding the following code at the start of your 2D script:
hotspot2 0, 0
circle2 0, 0, 0.1
This will draw a circle of radius 0.1m at the origin of the object.
You will see that the circuit wiring links directly to the center of this circle.
When you create your light objects, be sure to make them centered on the origin.
To move your current symbol to the origin:
1. Measure the distance between the object's origin (the center of the 1m circle) and the symbol center = x, y. Write these values on the back of an envelope.
2. Remove the code you entered above (i.e. hotspot2 0, 0 ... circle2 0, 0, 0.1)
3. Add the following code at the start of your 2D script:
add2 -x, -y
where in place of x and y you should enter the values you measured in step 1."
Anonymous
Not applicable
And here is an update (simplification) from Andrew.

"It looks like things may have changed a little in the way ArchiCAD creates objects.

Previously, saving the object from the origin as you were advised to do, would have worked fine. Now (ArchiCAD 16) all objects made in this way are set up so their origin is at the front, left corner of their bounding box.

My guess is that it is related to the new Morph function, where Graphisoft wants it to be as easy as possible for people to create morphs from any location in the project. It would be a pain for people to have to drag their morphs to the origin before they could save them as objects.

A better solution would have been to allow people to select the object origin with a mouse click.

This is all a bit of a pain, but after doing some tests here it looks like it might be easier than I thought to fix.

First, you should definitely construct the object pieces on the project origin, then save as an object/lamp or whatever.

When you open the object, the first few lines of script seem to be the key. You'll see one line that starts with the command 'mul2'. Leave that one as it is. The next line though will start with the command 'add2'. Comment this one out (type a '!' at the start of the line), and that should directly fix the problem without having to do any measurements.

I hope this helps."

It did.
Worked perfectly.
Thank you Andrew/
Cadimage for such prompt help, especially beyond regular tech support!!
http://www.cadimage.com/Products/Tools/Electrical