Hi,
I am currently using getmode to allow the user to select one or more entities, and my macro simply keeps the returned mode_type variable in memory for subsequent use (it is not used immediately after the getmode call, but may subsequently be used more than once before the user exists the macro).
But I have found an issue in that the mode variable returned by getmode appears to be related to the viewing projection in some way.
i.e. a mode that has been selected in plan view only seems to be valid in plan view. If I change to an elevation view then mode does not return any entities. If I change back to plan view then mode will once again return the expected entities.
Note that I am doing this in DataCAD 11, but I assume the same would apply to later versions?
In the context of my macro I want the selected entities to be valid in any viewing projection, so my question is:
Can anybody suggest a better way of storing the selection?
I have thought of the following possibilities:
1. Use a selection set. This is my preferred option at this stage. I could step through the 8 available sets and use ssLength to find one that is not in use (to ensure I didn't clobber a set that was being used for something else). But my question is: How many users are likely to already be using all 8 sets? Is this likely to be an issue?
2. Write an attribute to the selected entites and then use Mode_Atr to retrieve them. I assume that a mode_atr would not have the same view relationship, so I think this could work quite well. But am not sure of the wisdom of adding a temporary attribute to entities that the macro otherwise has no business in updating. Am I being a bit too cautious about this ?
3. Keep the individual entity addresses in memory. This could work, but is my least preferred option. I would store them in an array, but I would need to set a size for the array (so if the user selected more than that number of entities I would not be able to store them all).
4. Write the entity addresses to a file. I think this would be a viable options, but can I do this with Datacads file i/o routines??? The sample WRITE macro's WRITELIB.INC file declares f_wraddr as an external function, but I cannot see this documented anywhere in the DCAL manual (nor in the dcalnew.doc included with DataCAD 11).
5. Write the entity details to file. In this instance I do not need to modify the entity so don't really need to know its address. e.g. for a polygon I just need plyNpnt and plyPnt.
As stated, a selection set is my preferred option, but this is subject to ascertaining that very few users are likely to be already using all 8 sets. So I would be interested in anybody on this forum has an opinion on that?
Is there an obvious option that I have missed ?
Thanks,
David H.
I am currently using getmode to allow the user to select one or more entities, and my macro simply keeps the returned mode_type variable in memory for subsequent use (it is not used immediately after the getmode call, but may subsequently be used more than once before the user exists the macro).
But I have found an issue in that the mode variable returned by getmode appears to be related to the viewing projection in some way.
i.e. a mode that has been selected in plan view only seems to be valid in plan view. If I change to an elevation view then mode does not return any entities. If I change back to plan view then mode will once again return the expected entities.
Note that I am doing this in DataCAD 11, but I assume the same would apply to later versions?
In the context of my macro I want the selected entities to be valid in any viewing projection, so my question is:
Can anybody suggest a better way of storing the selection?
I have thought of the following possibilities:
1. Use a selection set. This is my preferred option at this stage. I could step through the 8 available sets and use ssLength to find one that is not in use (to ensure I didn't clobber a set that was being used for something else). But my question is: How many users are likely to already be using all 8 sets? Is this likely to be an issue?
2. Write an attribute to the selected entites and then use Mode_Atr to retrieve them. I assume that a mode_atr would not have the same view relationship, so I think this could work quite well. But am not sure of the wisdom of adding a temporary attribute to entities that the macro otherwise has no business in updating. Am I being a bit too cautious about this ?
3. Keep the individual entity addresses in memory. This could work, but is my least preferred option. I would store them in an array, but I would need to set a size for the array (so if the user selected more than that number of entities I would not be able to store them all).
4. Write the entity addresses to a file. I think this would be a viable options, but can I do this with Datacads file i/o routines??? The sample WRITE macro's WRITELIB.INC file declares f_wraddr as an external function, but I cannot see this documented anywhere in the DCAL manual (nor in the dcalnew.doc included with DataCAD 11).
5. Write the entity details to file. In this instance I do not need to modify the entity so don't really need to know its address. e.g. for a polygon I just need plyNpnt and plyPnt.
As stated, a selection set is my preferred option, but this is subject to ascertaining that very few users are likely to be already using all 8 sets. So I would be interested in anybody on this forum has an opinion on that?
Is there an obvious option that I have missed ?
Thanks,
David H.
David Henderson
dhSoftware - Add-on Macros for DataCAD
dhSoftware - Add-on Macros for DataCAD