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: 

How do you get more Automatic Property Definitions?

10 REPLIES 10
Reply
Message 1 of 11
rhouse
1065 Views, 10 Replies

How do you get more Automatic Property Definitions?

The specific example that I'm looking for is extracting data from polylines. But the concept would apply to many other items. For sake of this post, let's stick to simple items.

I want to add a Property Set Definition to my polylines. I can make a PSD, set it applying to polylines (2D and/or 3D), and select several Automatic Property Definitions. However, I cannot select polyline width.

How do I extract geometric data that does not show up automatically?

Thanks in advance.
10 REPLIES 10
Message 2 of 11
Mep09Developer
in reply to: rhouse

Well, for basic AutoCAD entities, that type of information could be extracted through programming code such as AutoLISP or .NET.
I'm not sure how to apply PSD's to these AutoCAD objects, but I think they are better suited for Architecture & MEP objects. What automatic defs can you see on a polyline when you try it?
Message 3 of 11
rhouse
in reply to: rhouse

Yes, I assume it is designed for MEP entities, but it has potential for so much more. Also, if there were a way to extract data not readily given (something a programmer didn't think anyone would need in real practice), then I could make very accurate accountings of just about anything.

For Polylines, I get the following under Automatic Property Source: Area, Closed, Color, Color-Text, Documents, Drawing Fingerprint Guid(?), Elevation, Handle, Hyperlink, Layer, Length, Linetype, Notes, Object ID, Object Type, Thickness.

If only there were some way to extract what we want. Is there some way to use LISP or .NET inside the Style Manager's Property Set Definitions? I can muddle my way through LISP, but I'd need some help on .NET.

Thanks for the help. Edited by: Rhouse on May 14, 2010 9:03 AM
Message 4 of 11
Martin__Schmid
in reply to: rhouse

There is no direct way to use LISP or .NET within a PS definition, but you could certainly extract the info from the object, and populate the result in a Manual property.

For the polyline example (getting the width), the likely reason this isn't an 'automatic' property is that the width is not a property of a polyline! Each segment of a pline can have a different width... actually, each endpoint of a pline segment can have a different width. I.e., select a pline and in the Properties palette... note that each vertex has a start segment width, and an end sgement width. If all widths are the same, then this will be reflected in the calculated field for Global width.

Hope that clarifies why 'width' is missing, and how programatically, such a field in a PSD would not be clear what 'wdith' would mean.... perhaps there is another way to tackle the problem you're trying to solve.


Martin Schmid
Product Line Manager
Mechanical Detailing and Electrical Design
Architecture, Engineering, and Construction
Autodesk, Inc.

Message 5 of 11
rhouse
in reply to: rhouse

Hmmm... Wishful thinking, I guess. I can come up with other (less automated) ways of extracting the data I need.

I guess what I'm looking for is alternative methods of generating useful schedules when the PSD is not readily available. A couple "For Examples" if you would like to ponder the idea:

1. Pipe PSD allows me to select an X, Y, and Z coordinate (start point) but no end point coordinate. For this, I suppose I could calculate the end based on the PSD "Rotation" and "Length", but the level of expertise cranks up a notch when the pipe slopes or is a riser (vertical). How could I select the "End Point" for a schedule? For discussion, let's say I'm calculating the Center of Gravity (COG) of my piping system for a floating vessel, i.e. oil rig.

2. Wall PSD allows various properties, but no selection of Endcaps (start and end) or segment type (line or arc). For discussion, let's say my Bill of Materials (BOM) requires a count of trim pieces which occur at exposed end-walls (as opposed to where one wall butts to another).

The above examples (including the Polyline issue) are things which I run into often. We manually do most of this, but wouldn't it be great if MEP would allow us to select them? I could have an accurate BOM with COG and weights all accounted for in one neat little package. MEP is close, but just not quite there. Edited by: rhouse on May 14, 2010 12:29 PM
Message 6 of 11
rhouse
in reply to: rhouse

I guess what I'm REALLY asking is this: "Is there a way to select data you know exists, but has not been pre-programmed into the PSD by AutoDesk programmers?" The programmers are good, but they can't always be expected to anticipate every way the program will be used. As software gets more advanced, clients tend to expect more from it (and us). Some platform flexibility would give us the ability to "make it up as we go".
Message 7 of 11
Martin__Schmid
in reply to: rhouse

As the other responder indicated, the API provides functionality to do all the things you've mentioned. AutoCAD has long been a platform that if the product doesn't do it natively, it is open and flexible to allow extension, and MEP is no different.

1. Pipe start and endpoitns are very easy to extract from the .NET API (perhaps even possible via LISP, but I haven't written LISP for about 7 years, so I can't say for sure). Computing the COG would be a bit more complex as we don't natively store the COG of fittings, and it can't necessarily be inferred by the geometry itself, but you could add this info to the parts (in the Catalog Editor) then analyze the data for a given layout.
2. I have focused primarily on MEP and haven't done much development with walls, but Endcaps are in the API, so perhaps what you're looking for is there.

.NET is generally the most flexible API... but I'm always impressed when someone does something quite elegent using LISP.


Martin Schmid
Product Line Manager
Mechanical Detailing and Electrical Design
Architecture, Engineering, and Construction
Autodesk, Inc.

Message 8 of 11
rhouse
in reply to: rhouse

Okay. Thanks.

I guess I must be getting old. LISP is what I know. But MEP is getting a bit complex to extract data easily by LISP.

Guess it's back to school with me; to learn .NET. It'll be difficult. I balked at learning diesel back in the day, so .NET will probably be no different. Something about old dogs and new tricks...
Message 9 of 11
Martin__Schmid
in reply to: rhouse

Well, you're learning MEP, so that's a step in the right direction :). FWIW, there's some samples in:
C:\Program Files\Autodesk\AutoCAD MEP 2011\Sample\VB.NET
C:\Program Files\Autodesk\AutoCAD MEP 2011\Sample\CS.NET
Depending on whether you want to look at Visual Basic code or C# code.

Good luck!
MS


Martin Schmid
Product Line Manager
Mechanical Detailing and Electrical Design
Architecture, Engineering, and Construction
Autodesk, Inc.

Message 10 of 11
Mep09Developer
in reply to: rhouse

.NET is not too bad to learn, I've only gotten into it in the past year or so.
If you understand AutoLISP (most people don't), you shouldn't have too much trouble there.
.NET can use different languages such as Visual Basic, C Sharp, and C Plus Plus.
If you are familiar with any of those, you're off to a good start. Or you might decide to use AutoLISP instead.
I have had limited success applying programs to MEP, though.
Many times, the ideas I have hit a roadblock (no examples, not supported, etc.) somewhere along the path to the solution.
It looks like, what you want to do, it might take a while to set things up how you want it programmatically.
You might have to take small steps at a time, depending on how much time you have to devote to it.
But, I will say, the more you try & learn, you get better at it and closer to your goal.

Also, in the AutoCAD discussion group, is a .NET discussion group if you should decide to dive into it. Edited by: Mep09Developer on May 14, 2010 3:17 PM
Message 11 of 11
TotalMech
in reply to: rhouse

this problem was already solved years ago.  Yes you can get to the "other" properties of an object that are "only" exposed to the programming side of the cad engine.  You do it by using this in your vbscript:

app.GetInterfaceObject

 

best post that eplains the possibilites can be found here:

http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=6057466&linkID=9240657

 

and here

http://usa.autodesk.com/adsk/servlet/ps/dl/item?linkID=9240657&id=7296778&siteID=123112

 

 

also note the items in the attachment to the post I made here in 2007

http://forums.autodesk.com/t5/AutoCAD-Architecture/Parent-object-s-Z-coordinate/td-p/1559875/page/2

 

Here is the psd code to get the endpoint of a pipe in MEP.  This is a moot point since the endpoint x,y,z is now exposed in 2011 as a automatic property set.  But the same snippet could be applied to any object and extract any property that is available only on the code side.

 

RESULT="--"

On Error Resume Next

Set app = GetObject(,"AutoCAD.Application.18.1")

Set aec = app.GetInterfaceObject("AecX.AecBaseApplication.6.5")

aec.Init app

Set util = aec.ActiveDocument.Utility

Set pipe = app.ActiveDocument.ObjectIDToObject("[ObjectID]")

pt1 = util.ConvertToVariantArray(pipe.StartPoint)

RESULT = pt1(2) - [ElevationFinishFloor]

 

 

also include this in your PSD to be able to alwasy check what version you are using so you can reference the correct one to get the results.

 

RESULT="--"

On Error Resume Next

Set app = GetObject(,"AutoCAD.Application.18")

RESULT = "Now running " + App.Name + " version " + App.Version

 

this was discussed a few times in the old autodesk forums but is difficult to find now.

here is some great posts that show what you can do to get all sorts of stuff into a PSD.  Just be aware that the version numbers are wrong so you can't cut and paste to 2011 and make it work.

http://blog.jtbworld.com/2007/01/adt-window-style-type-in-psd.html

 

http://architects-desktop.blogspot.com/2006_01_01_archive.html

 

http://forums.autodesk.com/t5/AutoCAD-Architecture/Scheduling-Structural-Member-start-x-y-z-and-end-...

 

http://forums.autodesk.com/t5/AutoCAD-Architecture/Calling-David-W-Koch/m-p/2667386

 

http://forums.autodesk.com/t5/AutoCAD-Architecture/Array-Values-In-VBA-VBScript/m-p/1692091

 

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost