[Plugin] AreaTextTag

[Plugin] AreaTextTag

Postby TIG » Thu Dec 22, 2011 4:37 pm

Copyright 2011-2017 TIG (c)
All rights reserved.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
###
Name:

TIG-AreaTextTag.rb

Description:

NOTE from v1.1 this tool loads as an extension and might need activating
using Window > Preferences > Extensions > AreaTextTag when it is first
installed. Thereafter it will load until you deactivate it.

It adds a submenu to the Plugins menu OR a Toolbar of the same name
which needs activating from View > Toolbars [after the Extension is
loaded]:-

'AreaTextTag Tools...' containing...

'Tag Picked Faces'
This lets you add a special 'AreaTextTag' onto a Face by Picking it.
This 'Tag' is a component flat 3d Text, colored 'black', although you
can recolor it later as desired.
This 'Tag' is glued to the picked Face, centered on the picked point
Because it is glued the 'Tag' moves with the Face.
The 'Tag' can be manually relocated anywhere on the Face's plane.
By default the area in the 'Tag' is formatted in 'm2' or 'ft2'
depending on the SKP's units.
The 'm2' value is rounded to 2 dp [12.34], and the 'ft2' value is
rounded to 1 dp [1.2].
These 'units' and 'dps' can be reset using the 'Change Settings...'
menu option.
By default the 'Tag' is simply named "1.23 m2" [assuming that's the
area/units], upon making it a dialog asks for the Tag's 'text', press
Cancel to leave it as "1.23 m2", or enter additional text and press
OK, the text/area updates with the new values.
NOTE: that there are several tricks to formatting the Tag's text:
You enter/reuse/leave <> where the 'area' value is to go.
updated area text will be added later, therefore text without a <> has
one appended so that the area is appended to it [with a units suffix].
Entering: <> or leaving the text blank OR pressing Cancel gives
"1.23 m2"
Using: <-> gives
"1.23" [i.e. no units suffix is shown]
Entering: Office 666 <> OR Office 666 [WITHOUT the <>]
"Office 666 1.23 m2"
Entering: Office 666 <->
"Office 666 1.23" [i.e. no units suffix is shown]
You can also add text after the 'area' thus:
<> Office 999
"1.23 m2 Office 999"
or
Office 666 <> (Admin)
"Office 666 1.23 m2 (Admin)"
You can also separate the text over two or more lines by including
'\n' to denote the newlines, e.g:
Office 666\n<>
"Office 666
1.23 m2"

From v3.0 you can also include a 'Perimeter' in the Tag.
Use the special character combination ||

Tiling Area <> Perim ||

Which would then display a tagged 1 m2 area thus:

"Tiling Area 1.00 m2 Perim 4.00 m"

The Perimeter is always given in the units / dp eqivalent to the area format.
Note that areas in Acres use ft and in Hectares use m, for their perimeters.

To suppress the Perimeter's units use the combination |-|

Note that the limitation on the characters that can be used in
the Text, '<>' and '<->' which determine where the numeric 'area' comes.
Note that from v3.0 || and |-| are reserved for the 'perimeter' comes
Commas ',' are best avoided if CSV files are anticipated as they are
replaced with a ';' anyway.

The Tool lets you place Tags until you press <Esc> or choose another
Tool to exit.
Later on, if desired you can Edit a 'Tag' - to change the its 'Text' -
e.g. to alter its associated room/area name - Select it and use the
appropriate 'Edit Selected Tag' tool.
If the associated Face is changed then you should Update the Tag so
that the reported area will be updated automatically for you.
If a Face is erased and it had an 'Tag' associated with it then that
Tag returns an error if you try to Edit it.
Note that AreaTextTags should always be placed in the same context as
the Face itself - in fact the tool prevents you selecting a face
outside of the active_entities.
From v1.3 there is an option to report 'Surface Areas'. If this is
set then a Face forming part of a larger mesh Surface [soft edges]
shows the area of the Surface rather than that of the Face itself.
Remember not to pick more than one Face within a mesh as you'll get
duplicate Tags.

'Tag Selected Faces'
Similar to 'Tag Picked Faces' but you Preselect the faces to be tagged
and there is no option to add additional text to the Tag, although you
can Edit a Tag later to add this. Also the Tags are glued on the
center of each Face, although these can be Moved later if desired.
Note that if there is no Selection you are give the option to Tag
ALL Faces in the active_entities...
From v1.3 there is an option to report 'Surface' areas. If this is
set then a Face forming part of a larger mesh Surface [soft edges]
shows the area of the Surface rather than that of the Face itself.
Because Selected Faces might belong to the same Surface, then only one
Face per Surface will be filtered from the Selected Faces.
To maintain control over which Face in a Surface gets the Tag added
the 'Tag Picked Faces' option is recommended [see above].

'Edit Selected Tag'
This opens a dialog in which you can change the 'Text' part of a
Selected AreaTextTag. It also updates the Tag to use the face's
current-area; however, the current Tag's units etc are retained, so to
update these to have the current-settings use the 'Update' tool...

'Change Settings + Tag Picked Faces'
This opens a dialog in which you can change the units that the
'Area Text Tag' will use from then on, drop a drop-down list, thus:
'Area Units:'
in2
ft2***
yds2
acres
mm2
cm2
m2***
hectares
m2(ft2)
The ones marked with *** are the automatic defaults for
imperial/metric SKP models.
The m2(ft2) option is for the UK where areas are measured in m2 BUT
commercial floorspace is rented in m2/ft2 ! With that option the dp is
overridden and m2 are reported to 1 dp and ft2 to 0 dp*** thus:
1.0 m2
(11 ft2)
The 'current units' etc are remembered within the saved model SKP,
across sessions.
In this dialog you can also change the Area Tag's
'Text DP:' - default 2 for m2 and 1 for ft2***
'Text Font:' - default 'Arial'
[some fonts might be unavailable on your OS]
'Text Alignment:'- default 'Center'- alternatives Left|Right [from v3.0]
'Text Height:' - default 100mm/4"

From v1.3 there's an option to
'Report 'Surface' Areas:' - default 'No'
If this is set to 'Yes' then any Face within a mesh Surface [soft
edges] is given a Tag that reports the Surface area, rather than just
the area of the Face itself.

On OK the 'Tag Picked Faces' Tool then starts, it will now use the
'current-settings'...

'Update Selected Tags'
All selected 'AreaTextTags' are updated
You are then asked if you want to update:
AREAS ONLY [=Yes]
or
AREAS AND ALL OTHER SETTINGS [=No]
i.e. to use the 'current-settings' - units, dps, font, height.
The current area of each Tag's 'glued_to face' is ALWAYS updated
within the Text of the Tag.
The Selection can contain other non-Tags, which will then be ignored.
Note that if there is no Selection you are give the option to Update
ALL Tags...
From v1.3 there's an option to 'Report Surface Areas:' if it's set to
'Yes' then any Face within a mesh Surface [soft edges] has a Tag that
reports the Surface's area, rather than just the area of the Face
itself. So any Face that has been changed since it was last Tagged,
or its Tag was updated, will also change the reported area -
e.g. Faces might have been added to [or removed from] a mesh, or the
Face itself might be not even be part of a mesh any longer.

'Export Tags' to CSV'
You must save a new model before running this tool.
It processes Tags in the current active context.
All Tags have their areas auto-Updated, then this tool runs.
Note that from v1.3 Faces that are part of a Surface will report the
Surface's are IF the current-settings specify this.
Any Tags that are NOT glued to a Face are NOT Reported [the closing
dialog tells this and highlights them].
Any Tags that are 'duplicated' on a Face are NOT Reported [the closing
dialog tells this and highlights them].
It then makes a report of the Tags in CSV format, listing them by:
LAYER, TEXT, PERIMETER, AREA, UNITS
Reporting the 'Layer' helps divide the results up, so putting your
Tags onto Layers named 'Level0', 'Level1' etc helps you use the report
more easily.
The reported Perimeter/Area is in each Tag's 'units' - typically m/m2
or ft/ft2 - however, areas in acres have perimeters is ft and if in
hectares perimeters are in meters.
If the units are 'm2(ft2)' two extra columns are added for AREA2 and
UNITS2 to show the m2 AND ft2 version.
Any commas [,] in reported Text/Layers are changed into colons [;] to
avoid formatting errors in the CSV.
If the Model name is XXXX the report is written into
XXXX_AreaTextTagReport.csv.
The CSV report is made in the Model's folder.
If that Report is already open [>>>error] you are told/warned.
Otherwise the CSV is written and on completion the CSV file is opened.
A CSV file is readable by Excel and similar programs.
It can be linked into a XLS file that has 'formatting' so then if the
CSV updates the pre-formatted linked XLS file will change to suit.

###

Download

4
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.0 20111222

Postby baldaman » Fri Dec 23, 2011 10:07 am

Finally you finished it!!!
:berserk:
Two question:
would it be difficult to have the possibility to tag an ensemble of selected faces without having to pick them?
would it be difficult to have the possibility to update an ensemble of selected tags without having to pick them?

Aera checking and reporting without leaving Sketchup: I dreamed of it for so long!
0

baldaman 
 

Re: [Plugin] AreaTextTag v1.0 20111222

Postby srx » Fri Dec 23, 2011 11:03 am

Fantastic. Thank you TIG! I'm now thinking of using SU more than Autocad :)
0
www.saurus.rs
User avatar
srx 
 

Re: [Plugin] AreaTextTag v1.0 20111222

Postby TIG » Fri Dec 23, 2011 12:57 pm

baldaman wrote:Finally you finished it!!!
:berserk:
Two question:
would it be difficult to have the possibility to tag an ensemble of selected faces without having to pick them?
would it be difficult to have the possibility to update an ensemble of selected tags without having to pick them?

Area checking and reporting without leaving Sketchup: I dreamed of it for so long!

In an early draft I had a mass tagger BUT it put the tag at each face's center and there was no opportunity to have additional text - so I shelved it.
As you would need to initially select these faces to tag them en mass then picking the face and adding a tag at the point, and then adding some additional text [or press enter to add 'none'] is little extra work and allows you more control over what you get - you'd need to go round relocating and Editing the extra text anyway ?.
You Edit ONE preselected tag at a time because you are changing its 'text' part, BUT you can select multiple tags and Update them en mass - since only the 'current-settings' and the face's area are changed in each tag. You don't need to pick tags individually to do this Update - you can select by picking using +Ctrl to add to the selection... OR even easier use a 'fence' to select them - because any non-tags are ignored you can have other objects in this selection so you don't need to be too careful, just make sure you've included what you want [non-tags are skipped anyway]...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.0 20111222

Postby baldaman » Fri Dec 23, 2011 2:43 pm

Thank you for your response
I think I understanded 90% (my english is not perfect)
My thought: I think majority of people will use it to check and report surfaces of different rooms in a building.
I mean if it is not for presentation purpose you don't really care about changing text but being able to select a bunch of rooms and tag them with a click could be really amazing!
Anazing, once again you bring Sketchup a step forward! :thumb: :thumb: :thumb: :thumb:
0

baldaman 
 

Re: [Plugin] AreaTextTag v1.1 20111224

Postby TIG » Sat Dec 24, 2011 3:12 pm

Here's v1.1 viewtopic.php?p=373717#p373717
Please re-read the instructions as there are some major changes...

    Now made as an Extension and a Toolbar has been added.
    Now comes as a .rbz installer or a .zip file to suit Sketchup v8M2 and earlier users...
    UK friendly 'm2(ft2)' units option added to Settings.
    Edit/Update now ensures each Tag is a unique instance.
    Update ALL active tags option added if there is NO initial Selection.
    Update highlights unglued/duplicated tags, for manual deletion.
    Update is now done automatically before making a CSV export.
    CSV report now ignores unglued/duplicated tags [highlighted for manual deletion].
    CSV report includes two extra columns if units are 'm2(ft2)'.
    New 'Tag Selected Faces' tool added for 'batch tagging' of Selected OR ALL active Faces.
Enjoy... :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby TIG » Mon Dec 26, 2011 12:44 am

Here's v1.2 viewtopic.php?p=373717#p373717
Please re-read the instructions as there are some changes...
    The Update Tool now has an option to update 'area only' OR 'everything' [Yes|No] - i.e. 'area AND text formating to current-settings'.
    The auto-update that runs before the CSV report is made now will only updates the areas and leaves the formating alone.
Enjoy... :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby baldaman » Mon Dec 26, 2011 2:20 pm

Thank you SANTIG CLAUS
:enlight:
0

baldaman 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby jim smith » Mon Dec 26, 2011 9:06 pm

A HEARTY THANK YOU TIG! :thumb: :thumb:

A very usefull and time saving tool
0
"Out of clutter find simplicity,
from discord find harmony,
In the middle of difficulty lies opportunity"
Albert Einstein
User avatar
jim smith 
Premium Member
Premium Member
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby lexmonteiro » Tue Dec 27, 2011 12:04 pm

Thank you so much! :berserk:
share the knowledge magnifies the world!
Happy new year!
0

lexmonteiro 
 

Re: [Plugin] AreaTextTag v1.0 20111222

Postby guanjin » Tue Dec 27, 2011 1:07 pm

Can not correctly display units, display units to meters. I can not upload pictures, thank you! !
0
User avatar
guanjin 
 

Re: [Plugin] AreaTextTag v1.0 20111222

Postby guanjin » Tue Dec 27, 2011 1:15 pm

Unit shows that correct? ? I have a problem or operation! Thank you!
0
User avatar
guanjin 
 

Re: [Plugin] AreaTextTag v1.0 20111222

Postby guanjin » Tue Dec 27, 2011 1:18 pm

Unit shows that correct? ? I have a problem or operation! Thank you!
未命名.jpg
0
User avatar
guanjin 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby TIG » Tue Dec 27, 2011 2:10 pm

Guanjin
Because you have a Chinese OS I suspect that the character-mapping is preventing the 'm2' >>> 'm²' etc.
However, it might be that the font you chosen doesn't have a '²' character ??
Try using 'Arial' to see this - as that should have all needed characters...

The code in the 'TIG-AreaTextTag.rb' file inside the 'TIG-AreaTextTag' subfolder can be adjusted to leave it as 'm2'. The dialogs use 'm2' etc BUT it then translates it into 'm²' for the text in the SKP...

To edit the code, open that TIG-AreaTextTag.rb file using Notepad.exe or a similar plain-text editor [NOT a wordprocessor]...

On lines #352, #532, #799 AND #951 you'll see this text
atxtu=atxt+" "+(@units.tr("2","²"))
edit them to read
atxtu=atxt+" "+(@units.tr("2","2"))
Also just below on lines #355, #535, #802 AND #954 it reads
atxtu=atxt+" m²"
change them to
atxtu=atxt+" m2"
and just below on lines #357, #537, #804 AND #956 it reads
atxtu2=atxt2+" ft²"
change them to
atxtu2=atxt2+" ft2"

OR you can simply use 'find/replace' for the text '²' replacing it with '2' :roll:

Save and restart Sketchup, the areas should now report as 'm2' etc...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby guanjin » Tue Dec 27, 2011 2:18 pm

TIG wrote:Guanjin
Because you have a Chinese OS I suspect that the character-mapping is preventing the 'm2' >>> 'm²' etc.
However, it might be that the font you chosen doesn't have a '²' character ??
Try using 'Arial' to see this - as that should have all needed characters...

The code in the 'TIG-AreaTextTag.rb' file inside the 'TIG-AreaTextTag' subfolder can be adjusted to leave it as 'm2'. The dialogs use 'm2' etc BUT it then translates it into 'm²' for the text in the SKP...

To edit the code, open that TIG-AreaTextTag.rb file using Notepad.exe or a similar plain-text editor [NOT a wordprocessor]...

On lines #352, #532, #799 AND #951 you'll see this text
atxtu=atxt+" "+(@units.tr("2","²"))
edit them to read
atxtu=atxt+" "+(@units.tr("2","2"))
Also just below on lines #355, #535, #802 AND #954 it reads
atxtu=atxt+" m²"
change them to
atxtu=atxt+" m2"
and just below on lines #357, #537, #804 AND #956 it reads
atxtu2=atxt2+" ft²"
change them to
atxtu2=atxt2+" ft2"

OR you could try to use 'find/replace' for the text '²', replacing it with '2'... :roll:

Save and restart Sketchup, the areas should now report as 'm2' etc...



Thank you for your reply, I went to give it a try! Thank you! :family:
0
User avatar
guanjin 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby guanjin » Tue Dec 27, 2011 3:39 pm

The first problem to solve, but the button 2 to select or m
Demo map
11111111c.gif
0
User avatar
guanjin 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby TIG » Tue Dec 27, 2011 4:00 pm

You must change the '²' in several places in the file... looks like you missed some of them... 'find' every '²' and make it into a '2'... it clearly works for the lines that you have adjusted successfully... One last try :)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby guanjin » Tue Dec 27, 2011 4:34 pm

TIG wrote:You must change the '²' in several places in the file... looks like you missed some of them... 'find' every '²' and make it into a '2'... it clearly works for the lines that you have adjusted successfully... One last try :)


Problem solved, thank you again! Master :thumb: :thumb: :thumb: :thumb:
0
User avatar
guanjin 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby Jorgensen » Thu Dec 29, 2011 10:59 pm

Hi TIG

I think this plugin could become very usefull for me :-)

But I have some problems, but it might just be me that use it wrong.

My workflow would be, create some rectangles and add the tag e.g.:
office (30)\n<> where 30 is the size the client would like.

But the problem is that the different rooms can't be grouped, so when they get close to one another the 'glue' together.

Could it be an idea that the tags glues to groups ?

Just an idea :-)

some other future features could be:
import excel / csv files and automatic create the rooms
room_name room_size
office 20

Scheme
Generate a scheme that calculates the actual room size vs the size client wishes.

Thanks
I really admire the hard work you (and others) do to improve SU.

ps. SU7 seems to crash when using this plugin.
0

Jorgensen 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby TIG » Fri Dec 30, 2011 10:26 am

Bo

You can group faces and still apply Tags.
You simply need to edit that group and then apply an AreaTextTag onto a face within that group: the only 'rule' is that the face and its Tag must be in the the same 'context' - i.e. active_entities set.
I have already written a commercial toolset for a US Space-Planning/Architects company which imports/exports data from/to XLS/XLSX files and creates/writes rooms to match... however, it's not publicly available - but it is quite do-able...
It should work OK in v7... what error messages do you get ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby Jorgensen » Fri Dec 30, 2011 3:36 pm

Hi TIG

Thanks for your reply.

Su7 crashes when I select "add.... to selected faces" SU quits and a splashscreen pops up.

I was not awere of the "inside the group" feature.

You write that You have made a 'pro' version. Do you consider releasing a commerciel Pro version ?

Thanks
0

Jorgensen 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby arqitect » Sun Jan 01, 2012 3:38 am

Hi TIG,
When applying the plugin to a selection set, would it be possible to process softened meshes as single entities? Basically output the sum area of all sub faces in similar way to what sketchup contextual command does. It would be very useful as an option.
Many thanks
0

arqitect 
 

Re: [Plugin] AreaTextTag v1.2 20111226

Postby TIG » Sun Jan 01, 2012 1:10 pm

arqitect wrote:Hi TIG,
When applying the plugin to a selection set, would it be possible to process softened meshes as single entities? Basically output the sum area of all sub faces in similar way to what Sketchup contextual command does. It would be very useful as an option.
Many thanks
It'd not be that easy to code in... I'll think about it... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.3 20120102

Postby TIG » Tue Jan 03, 2012 1:02 am

Here's v1.3 viewtopic.php?p=373717#p373717
When the new additional current-setting - "Report 'Surface' Areas:" - is set to "Yes" then any Tag for a Face forming part of a 'Surface' [a mesh with soft edges] will report that Face's linked 'Surface' area, and not the area of just that Face itself: in any CSV report the area/perimeter of a Face's linked Surface will also be used, rather than the area/perimeter of that Face itself.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.3 20120102

Postby Jorgensen » Tue Jan 03, 2012 7:30 am

Hi TIG

Would it be possible to add the "generate faces via excel / csv" ? Maybe as an comercial plugin?

Thanks :-)
0

Jorgensen 
 

Re: [Plugin] AreaTextTag v1.3 20120102

Postby TIG » Tue Jan 03, 2012 8:38 pm

Jorgensen wrote:Hi TIG, Would it be possible to add the "generate faces via excel / csv" ? Maybe as an commercial plugin? Thanks :-)
My current toolset's code XLS>geom/geom>XLS toolset is subject to an NDA etc... BUT if you want to continue this discussion through PMs then I might be able to come up with something to suit you/others... ;)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.3 20120102

Postby Michaelv » Wed Jan 11, 2012 4:46 am

Thanks TIG, great plugin again.

I don't use area but it could be useful for tagging surfaces with any text.
So would it be possible to include a first choice in the settings yes or no as to "Automatic area". Yes would leave it as is, No would only put the area if <> is not erased or added, but if <> is erased then only the text is used (not automatically including the area).

If you want me to code it in there I probably can. (it's not as obvious as I thought when I first looked, but it could be a good exercise for me)

Thanks
0

Michaelv 
 

Re: [Plugin] AreaTextTag v1.3 20120102

Postby TIG » Wed Jan 11, 2012 9:38 am

Michaelv

I don't think you need to reinvent the wheel...
There is my 'old' 2dText which already lets you stick a piece of text onto any surface AND has far more control over its 'format' [height, color, etc], and it is fully 'editable' later, with a right-click Edit option...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] AreaTextTag v1.3 20120102

Postby Michaelv » Wed Jan 11, 2012 7:22 pm

OK Thanks.

Indeed. I never realized 2D text was working like that as I usually only use the 2D tools in the top view.

Thanks for all.
0

Michaelv 
 

Re: [Plugin] AreaTextTag v1.3 20120102

Postby arqitect » Sun Jan 22, 2012 11:26 pm

:thumb: Great job TIG,
Just checked it, really useful now..
Many thanks
0

arqitect 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: cristineyfrank, daniloarq2013, Emilie12545, fredo6, kempftomas and 39 guests

Visit our sponsors: