Monthly Archives

You are here: Home » 2014 » March

Block vs Parametric based MvParts

Posted by  | Categories: Autocad MEP, Multi-View Parts

There are two types of parts in an Autocad MEP MvPart Catalog.  A block based MvPart and a Parametric MvPart.  Block based parts are created from 3D solids or Mass Elements.  Additional sizes that are added to the part are done by creating a new block and adding it to the catalog drawing file.  Parametric parts are created using dimensions and constraints.  All sizes are modeled from a single part that is ‘flexed’ by its parameters to create a almost unlimited amount of size combinations.  Even though each part type is created using content builder, the interface to do so is decidedly different for a block based part than that for a parametric part.  The main advantage of a parametric based part is that it is quite easy to create new custom sizes as long as the model is built correctly.

How do you tell when adding a part if it is parametric or block based?  It is quite easy by looking at the icon of the part in the Add Multi-View Parts Dialog.  The picture below is worth a thousand words.

Block vs Parametric Based Multi-View Part

Block vs Parametric Based Multi-View Part

Undocumented property set definitions continued

Posted by  | Categories: Autocad MEP, Property Sets

 

In the last post we looked at how to add an undocumented property to a property set definition.  This time lets try to add a formula based location property to a space object using the method from the last post.

RESULT="NA"
On Error Resume Next
Set AcadApp = GetObject(, "AutoCAD.Application")
Set MEPObject = AcadApp.Activedocument.Objectidtoobject("[ObjectID]")
RESULT= MEPObject.location

When this property definition is created and made visible there is no information being reported.  The property definition is blank.  Why is this?  This is because a location property is actually made up of three different values (x,y, and z) that are stored as a point object in the system.  VBScript does not know how to read point objects so the point object will first need to be converted into an array before it can read.  The following code gets the space location and breaks the location point up into its 3 separate values and then concatenates them together as a string so we can read them and returns the result.

On Error Resume Next
DecimalPlaces = 8
Set acadApp = GetObject(,"AutoCAD.Application") 

'ACADVER values:
'ACA 2010 = "18.0s (LMS Tech)" 
'ACA 2011 = "18.1s (LMS Tech)"
'ACA 2012 = "18.2s (LMS Tech)"
'ACA 2013 = "19.0s (LMS Tech)" 
'ACA 2014 = "19.1s (LMS Tech)" 
'ACA 2015 = "20.0s (LMS Tech)" 

acadVerString = acadApp.ActiveDocument.GetVariable("ACADVER")

'Set ACA application string, based on version running: 
Select Case acadVerString 

	Case "18.0s (LMS Tech)"  'ACA-2010 
		aecBaseVer = "AecX.AecBaseApplication.6.0" 

	Case "18.1s (LMS Tech)"  'ACA-2011 
		aecBaseVer = "AecX.AecBaseApplication.6.5" 

	Case "18.2s (LMS Tech)"  'ACA-2012 
		aecBaseVer = "AecX.AecBaseApplication.6.7"

	Case "19.0s (LMS Tech)"  'ACA-2013 
		aecBaseVer = "AecX.AecBaseApplication.7.0"

	Case "19.1s (LMS Tech)"  'ACA-2014 
		aecBaseVer = "AecX.AecBaseApplication.7.5"

	Case "20.0s (LMS Tech)"  'ACA-2015 
		aecBaseVer = "AecX.AecBaseApplication.7.7"

	Case Else 
		aecBaseVer = "Unknown" 

End Select 

If aecBaseVer = "Unknown" Then 
	RESULT = "Unknown Version"
Else
	Set aecBase = acadApp.GetInterfaceObject(aecBaseVer)
	aecBase.Init acadApp
	Set SpaceObject = acadApp.ActiveDocument.ObjectIDToObject([ObjectID])
	Set UtilityObject = aecBase.ActiveDocument.Utility

	' Get the Location of the SpaceObject and break down into individual X, Y, and Z parts
	SpaceObjectLocation = UtilityObject.ConvertToVariantArray(SpaceObject.Location)
	LocationX = Round(SpaceObjectLocation(0), DecimalPlaces)
	LocationY = Round(SpaceObjectLocation(1), DecimalPlaces)
	LocationZ = Round(SpaceObjectLocation(2), DecimalPlaces)

	'Return the results
       RESULT = Cstr(LocationX & ";" & LocationY & ";" & LocationZ)
End If

The value of the property definition should look something like this 144.124;1200.375;0.  This would place the space object 12′-0 1/8″ on the positive X axis, 100′- 0 3/8″ on the Y axis and at a zero elevation.  If you would like to see more or less decimal places in the result then you can change the second line of code from DecimalPlaces = 3 to DecimalPlaces = X where X is the amount of decimal places you would like to see.  And finally if you are only interested in the elevation of the space then you can modify the result of the script to instead say RESULT = LocationZ.  There is no need to convert to a string in this case as a number would be more preferable as the units of the property definition could then be set to a length value and read as feet and inches.

 

Space Object Location

Space Object Location

Undocumented Property Set Definitions

Posted by  | Categories: Autocad MEP, Property Sets

If you heavily use property sets then at one time or another you have found the need to schedule a property that is not readily available via an automatic property definition.  For example when creating a pipe system you can assign it a system family (commonly known as group) that will allow different systems of the same family to interconnect.  Systems that are not of the same group will not interconnect.  This could be a handy property to schedule but how do you do it?  System group is not an automatic property of MEP objects.

First start the style manager and then open up the property set that you wish to add the system family definition to.  The first thing that needs to be done is to add the automatic property definition ObjectID to the property set.  This is needed to access information about the object.  Then just add the following code to a formula based property definition:

RESULT="NA"
On Error Resume Next
Set AcadApp = GetObject(, "AutoCAD.Application")
Set MEPObject = AcadApp.Activedocument.Objectidtoobject("[ObjectID]")
RESULT= MEPObject.SystemFamily
 

Make sure to input [ObjectID] by clicking on the definition in the Insert Property Definition section in the lower left portion of the dialog window.  Hit Ok and make sure to make your new property definition viewable so you can see it on the property palette’s extended tab.

System Family Formula Editor

System Family Formula Based Property Definition

 

 

 

 

 

 

 

 

 

 

Displaying Tag Anchors

Posted by  | Categories: Autocad MEP, Display Manager, Tags

In a heavily populated drawing you can accumulate alot of annotation tags and it can become quite difficult to see what they actually are attached to.  You can easily display the link between the tag and the parent object by some simple Display Representation manipulation.  Lets get started!

First we need to start the display manager by either typing DISPLAYMANAGER at the command line or by selecting it on the Manage tab of the ribbon.  In the display manager expand the Sets node of the tree and scroll down until you come to the current active display set.  This will be the text highlighted in bold.  Select the active display set and in the right hand side select Anchor Tag to Entity and Anchor Extended Tag to Entity under the General Column as shown in the picture below.  Press Ok to update the changes and you now have a drawing that shows the anchor relationships between tags and the objects they are attached to!

Anchor Tag to Entity

Selecting Anchors in the Display Manager