changing visible-state of a layer (before addon quits)
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-11
09:52 PM
- last edited on
2023-08-07
11:32 AM
by
Doreena Deng
2006-01-11
09:52 PM
Hi 🙂
I try to make a layer invisible from the modal dialog of my addon.
Problem: The layer does not becomee invisible before the dialog is closed.
I think this are the relevant lines of my code:
mAcAttribute.layer.head.flags = APILay_Hidden;
GSErrCode err = ACAPI_Attribute_Modify(&mAcAttribute, NULL);
GSErrCode err = ACAPI_Database(APIDb_RedrawCurrentDatabaseID, NULL, NULL);
I hope someone has a hint for me 🙂
Does "APIDb_RedrawCurrentDatabaseID" not cover layers?
regards,
John Mueller
I try to make a layer invisible from the modal dialog of my addon.
Problem: The layer does not becomee invisible before the dialog is closed.
I think this are the relevant lines of my code:
mAcAttribute.layer.head.flags = APILay_Hidden;
GSErrCode err = ACAPI_Attribute_Modify(&mAcAttribute, NULL);
GSErrCode err = ACAPI_Database(APIDb_RedrawCurrentDatabaseID, NULL, NULL);
I hope someone has a hint for me 🙂
Does "APIDb_RedrawCurrentDatabaseID" not cover layers?
regards,
John Mueller
Labels:
- Labels:
-
Add-On (C++)
6 REPLIES 6
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-12 02:34 PM
2006-01-12
02:34 PM
> Does "APIDb_RedrawCurrentDatabaseID" not cover layers?
I found something:
GSErrCode err = ACAPI_Automate(APIDo_RedrawID, NULL, NULL);
now the handles of the selected elements painted in light grey instead of black when setting layer to be invisible.
the elements do not become invisible befor the addon quits.😞
Has no one ever tried to switch the visible-state of a layer during the addon is running?
I found something:
GSErrCode err = ACAPI_Automate(APIDo_RedrawID, NULL, NULL);
now the handles of the selected elements painted in light grey instead of black when setting layer to be invisible.
the elements do not become invisible befor the addon quits.
Has no one ever tried to switch the visible-state of a layer during the addon is running?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-13 12:11 AM
2006-01-13
12:11 AM
John wrote:John,
Hi🙂
I try to make a layer invisible from the modal dialog of my addon.
Problem: The layer does not becomee invisible before the dialog is closed.
I don't it is possible for changes like this to be displayed while a modal dialog box is active.
It sounds to me as if you might be trying to work against ArchiCAD's UI principles. Can you roughly describe why you want to do this? There may be a better approach to the problem.
Ralph.
Ralph Wessel BArch
Central Innovation
Central Innovation
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-13 07:54 AM
2006-01-13
07:54 AM
Hi Ralph :-)
The Addon processes the selected lines, arcs and polylines and closes the gaps between the elements if the distance is below a defined threshold.
A new polyline containing the elements is created.
Example:
line1 (0/0)(1.0001/0.9991)
line2 (1/1.0001)(2/0)
->
polyline (0/0)(1/1)(2/0)
The original-elements are on layer A.
The polyline is created on an layer B.
I want to to toggle between:
1. A visible / B invisible
2. A invisible / B visible
Elements the addon could not connect to a polyline because of ambiguity are to be moved to a problem-layer.
Example:
line1 (0/0)(1.0001/0.9991)
line2 (1/1.0001)(2/0)
line3 (0.0009/1.0001)(0/2)
greetings,
john
Ralph wrote:Sure:John wrote:Can you roughly describe why you want to do this? There may be a better approach to the problem.
Hi 🙂
I try to make a layer invisible from the modal dialog of my addon.
Problem: The layer does not becomee invisible before the dialog is closed.
The Addon processes the selected lines, arcs and polylines and closes the gaps between the elements if the distance is below a defined threshold.
A new polyline containing the elements is created.
Example:
line1 (0/0)(1.0001/0.9991)
line2 (1/1.0001)(2/0)
->
polyline (0/0)(1/1)(2/0)
The original-elements are on layer A.
The polyline is created on an layer B.
I want to to toggle between:
1. A visible / B invisible
2. A invisible / B visible
Elements the addon could not connect to a polyline because of ambiguity are to be moved to a problem-layer.
Example:
line1 (0/0)(1.0001/0.9991)
line2 (1/1.0001)(2/0)
line3 (0.0009/1.0001)(0/2)
greetings,
john
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-13 08:56 AM
2006-01-13
08:56 AM
Maybe you could just use a modeless dialog. Why does it have to be modal?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-13 09:05 AM
2006-01-13
09:05 AM
adambutler wrote:Oh, do you think it would work with a modless dialog? That would be great 🙂
Maybe you could just use a modeless dialog. Why does it have to be modal?
I tried a modeless dialog, but it closed immediately, after I created it and the addon quits.
Docu says: "DGModelessInit returns immediately as soon as the dialog is created."
Hmm, do you have a hint how to keep the addon running?
I am a rooky... Is there a way to code an idle-loop or what is the way you would handle this?
I will browse the docu again 🙂
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-13 12:09 PM
2006-01-13
12:09 PM
John wrote:John,
The Addon processes the selected lines, arcs and polylines and closes the gaps between the elements if the distance is below a defined threshold.
A new polyline containing the elements is created.
...
The original-elements are on layer A.
The polyline is created on an layer B.
...
I want to to toggle between:
1. A visible / B invisible
2. A invisible / B visible
The process you describe raises a lot of questions. I don't understand why you need a dialog for this at all - could it work in the following way:
- 1) The user selects the elements they want to join
2) The user picks a menu item from your add-on
3) The add-on joins the elements (if possible) and creates a new polyline element.
4) The add-on deselects the original elements and creates a selection with the new polyline.
Also, the magic wand is pretty good at joining elements. Perhaps you are looking at larger tolerences than it works to?
Ralph.
Ralph Wessel BArch
Central Innovation
Central Innovation