Community
AutoCAD MEP Forum
Welcome to Autodesk’s AutoCAD MEP Forums. Share your knowledge, ask questions, and explore popular AutoCAD MEP topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MEP 2013 Custom Tag color functions

6 REPLIES 6
Reply
Message 1 of 7
BeauregardT
782 Views, 6 Replies

MEP 2013 Custom Tag color functions

So,

I've created a custom tag for identifying the top and bottom of duct elevations with one click. The tag reads the object properties that i defined in the style manager in order to do this. The only problem is when the duct gets broken (by adding volume dampers) it reads the object properties of the duct that ends up not existing and, as a result, represents a false elevation.

 

My goal is to write a script in the object property definition that will make these tags automatically change their color if the objects length equals zero.

 

I am not familiar with writing script, please help.

 

See attached for reference.

6 REPLIES 6
Message 2 of 7
Keith.Brown
in reply to: BeauregardT

I am not sure if that exact course of action is going to solve your problem.  The reason being is that the tag is no longer associated with any piece of ductwork.  Once it is no longer associated with anything it just displays its last known value.  This is a bug in MEP.  

 

Your best bet would be to write a script that cycles through all of your tags and if the tag is not associated with anything then delete it or if you want just change its color.  

 

I know how to do this using C# but unsure of how to go about it using any other language or a script in a property set definition.  I believe that it is possible to do this in a property set definition but would require a knowledge of VBA which I do not have.  In C# you would need to grab all your aecbMvBlocks and then cycle through each of them.  For each block you would need to create a relationship manager and cycle through all of the relationships.  At the end if one of the relationships is a duct then move to the next tag.  If no ducts was found then you would process the current tag by changing its color.

 

 

Another option would be to wait until you have applied all of your dampers before placing your tags.  One more option would be to move all of your ductwork to another location.  Any tag that did not follow has a broken anchor.

Message 3 of 7
VitalyF
in reply to: BeauregardT

Duct length = 0 is not really, this is a bug.

 

Start to control the length of 100-200mm

 

Then the formula will be the next

 

 

If [Length] <= 100 Then RESULT = "N/A"  Else RESULT = "[Length]"

 Or take the aspect ratio (H x W) and the Length of the duct as a criterion

 

Message 4 of 7
Keith.Brown
in reply to: BeauregardT


@BeauregardT wrote:

 The only problem is when the duct gets broken (by adding volume dampers) it reads the object properties of the duct that ends up not existing and, as a result, represents a false elevation.

 


 While on the surface this is what appears to happen it is not actually what is happening.  To prove it, add an automatic property definition to your property set and assign it to HANDLE.  Before adding the damper to your duct make sure that you note what the HANDLE of the duct is.  Now add the damper and look at the HANDLE of the two ducts on either side of the damper.  One of them has the same HANDLE as the original duct and one of them is new.  This proves that the duct is not being deleted, it is just being modified.  The HANDLE is an identifier that AutoCAD uses to distinguish between items in a drawing.  It is unique in the drawing so therefore no two objects will ever have the same HANDLE in a dwg.  So what does this mean?  It means that the tag that was associated with the duct prior to adding the damper is no longer associated with any item in the drawing.  You can prove this by moving your duct around, changing the elevation, etc.  The value on the tag will not change.  

 

So....  Checking for a length whether it is 0, or less than 4 inches (100mm) or any value that you can dream of will not help you in any way to determine if the tag is attached to an object.  

Message 5 of 7
BeauregardT
in reply to: Keith.Brown

does the tag recognize that is associated with nothing or is that the bug that you speak of?
So far the solution i like the most is putting the vds in before i tag the duct. None the less i could insert the VD <=12" from the tap each time and write a line that tells the tag to change to "N/A' if the Length <=12" (id rather it turn a different color but N/A will work)

The issue now is that i dont want to display the length information in the tag, i just want to use the information from the length to determine whether the tag displays the TOD/BOD elev. or "N/A".

Again, i only understand the logic behind code, im definitely not familiar with writing it at all.
Message 6 of 7
Keith.Brown
in reply to: BeauregardT

The tag is not anchored to any object so it doesnt recognize any property set values so once the damper is in place i believe that the tag will continue to keep its last value until it is properly anchored to another piece of ductwork or until it is deleted.  You can reanchor the tag by selecting it and chosing the TAGANCHOR option.

 

As i mentioned before, trying to set a property definition to check the length of the ductwork to control the tag will NOT work in this case.  The tag is not anchored to any object.  It is orphaned and thererfore does not associate itself with any object. (i.e. It doesnt have a parent object)  You can modify the property sets all you want and it just will not matter. 

 

I am not sure if this is considered a bug or a design decision.

 

You could also just place the damper on the tap and solve your problem that way.  Since the tap is a fitting the damper cannot break it into two pieces.  Also it will not automatically anchor to the fitting so you will need to manually anchor using one of the anchors offered by AutoCAD MEP.  The easiest option would be to use the object anchor which can be placed by starting the OBJECTANCHORATTACH command.

Message 7 of 7
BeauregardT
in reply to: Keith.Brown

So the TAGANCHOR command doesnt work but the TAGANCHORSET command works perfect.
Now i am trying to create an alias for this command and a shortcut under the quick access toolbar. When i try to add the command it does not show up in the command lists.

please help

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost