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

Removing only X and Y coordinates from Connections and continuations on an Iso

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
Garrett.Brothers
2590 Views, 14 Replies

Removing only X and Y coordinates from Connections and continuations on an Iso

This has been asked before.  Specifically, this post  (2020) detailing Elevation and ElevationExtended in ElevationScheme in IsoConfig.xml, this post (2012) detailing the same thing, this post (2013) that references the information in the first two posts, and this post (2015) that nobody answered.

 

The question is simple.  On many connection and continuation callouts, the coordinates (X, Y, and Z) display by default.  There's an option under project setup (annotations, connections and continuations) to turn these three off together.  Some people have wondered if there's a way to disable just the X and Y coordinates, leaving the elevation on the annotation.  The longstanding established answer is that you cannot directly disable two of the coordinates without also disabling the third.  The only solution would be to edit the PCF files manually.  As @h_eger notes [in the first post, above], you don't want to do that.

 

My question: can we turn off the automatic coordinates, but add the elevation/z-coordinate back on in some other way?  I would suspect it has something to do with project setup, annotations, connections and continuations, then either the "Connection prefix" or "Connection text" fields (see attached screenshot).  There's a button right by connection text that lets you select properties from a list, adding them into the connection text field surrounded by angle brackets.

 

The reason I'm posting to forums is because despite my tinkering, I haven't been able to figure out how to add elevation on.  "<PipeRunComponent.Position Z>" and "<EngineeringItems.Position Z>" both seem promising, but I can't get them to actually produce anything on the tag.

 

In terms of help documentation, this article (2016) by AutoDesk Support suggests something of the like should be possible, while this article (2018) (also by AutoDesk Support) suggests you cannot do anything of the like without going into the PCF files.

 

I know I'm close.  Does anyone know how to do this?

 

EDIT: Removed "\" characters in properties above.  Using Plant 2020, but this should be universal (or at least applicable to many versions of plant).

Labels (1)
14 REPLIES 14
Message 2 of 15
h_eger
in reply to: Garrett.Brothers

Dear @Garrett.Brothers ,

 

First of all, very kudos for researching this article. I think you found everything that was written on this subject.
Unfortunately, I cannot give you too much hope for a solution.
The "CO-ORDS" function comes from the PCF standard and is hard-coded in AutoCAD Plant 3D.
IMHO there is no alternative to affect this function.

2021-02-18_12-56-16.jpg

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



Message 3 of 15
Garrett.Brothers
in reply to: h_eger

Hartmut ( @h_eger ),

 

When you said "IMHO there is no alternative to affect this function," do you mean we specifically cannot adjust the fields specified in the PCF?  Or do you mean to say there is no way to have the elevation display whatsoever?

 

I don't doubt your 30 years of experience.  However, this article [also linked in original post] leaves me confused.  Could you help me understand what the "Connection text" field under Project Setup > Annotations > Connections and continuations is used for?  The article uses that field to adjust one of the callouts.  Can we add properties (like <PipeRunComponent.Position Z>) here as well?  It seems like there should be some way to reference the z coordinate property of the equipment, completely separate from evoking the original CONNECTION-REFERENCE in the PCF.

 

EDIT: I've found this link that more clearly shows what I mean.  Can this work with elevation?  It didn't work when I tried it, but I don't know if I did something wrong or if it doesn't work in general.

 

EDIT2: This link seems even clearer.  I'm currently testing to see what it does and if I can puzzle things out for myself using it.

Message 4 of 15

@dave.wolfeIn 2013, you replied as the 9th comment in this thread, linking to this document.  That same document page appears in later help documentation here.  You seem knowledgeable in this area.  Do you think you could help me out?

 

I'm trying to set up iso continuation/connection text callouts to have just the elevation without the other two coordinates.  Customizing the coordinate callout directly is difficult, if not impossible.

 

I'm a little confused because I feel like it should be possible to use properties like "<PipeRunComponent.Position Z>" or "<EngineeringItems.Position Z>" to imitate the coordinate callouts in project setup.  Do you understand what I'm trying to do?

 

I suspect I misunderstand what the use of the "connection text" field is for in the annotations node of project setup and it is, indeed, not possible to set up the callouts like this.

Message 5 of 15

Final update: for everyone who finds this post years from now:

 

I've accepted h.eger's solution.  It appears there is no easy way to call out the elevation by itself on connection/continuation piping.  The main reason is as h.eger said/as is posted above (it has to do with the PCF files).

 

The reason my workaround idea doesn't work, as I understand it, is in part due to Calculated Properties.  You can read about them in two articles here (2015) and here (2013) (credit to Jabowabo for finding them, in this post).  I'm working to understand them myself (for other reasons than just this question), but it gets complicated.  Honestly, you're better off just adjusting the callouts manually.

 

EDIT: I keep forgetting to say this, but thank you @h_eger for your reply.  I really do mean it.

Message 6 of 15
h_eger
in reply to: Garrett.Brothers

I haven't forgotten you yet, but the next meeting with the developers is on February 25th, 2021

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



Message 7 of 15
jabowabo
in reply to: Garrett.Brothers

We run all isos through a post-processing cleanup routine in batch that fixes miscellaneous issues that the built-in functions can't quite do. It's a workaround but this would be one of those things that I would address with this. You could do this with the LISP or .NET API.

 

Psuedocode:

find all MTEXT in drawing
foreach MTEXT
  if mtext.starts with "CONN. TO"
    new newMtextString = ""
    split mtext lines by line breaks (new line)
    foreach split
      if not split startswith "E " or split startswith "N "
        newMtextString += split
    end foreach
    mtext.content = newMtextString
  end if
end foreach MTEXT

 

Message 8 of 15
Garrett.Brothers
in reply to: jabowabo

I'm waiting to hear what Hartmut learns from meeting with the developers, but batch files sound amazing!

 

I've heard of batch files before, but that's where the familiarity ends -- I don't think I know enough to teach myself how to use them in Plant 3D.  Could you please link me to some articles I could read to get started, show me good places to look to begin researching, or explain a little more about it?  What do you fix with yours?  I could make this its own forum post once I (inevitably) run into questions, as we've branched away from the original question.

 

In my initial research, I found this post (2016) with a batch file to run Isos overnight (rather useful!) as well as this post (2020) that links to a 2018 article on converting Plant3D to Revit using a dll.  Things dried up for me after that, though it was just a quick peek at what I could find.  Anything you could give me would help, Jason.

Message 9 of 15
jabowabo
in reply to: Garrett.Brothers


@Garrett.Brothers wrote:

 

I've heard of batch files before


To be clear I'm not saying to use batch (.bat) files but to use one of the APIs to process files in batch.

 


@Garrett.Brothers wrote:

Could you please link me to some articles I could read to get started, show me good places to look to begin researching, or explain a little more about it? 


It depends on which API you use - either one is going to take some initial time investment to get started. The LISP API is the quickest to get going on but I'm not very knowledgeable in it. Here's a few links that may help:

get specific text entities

split text string to list 

check for string match (wcmatch)

concatenate string (strcat)

 

The .Net API takes a little longer to get started but is much more robust (and readable in my opinion). You should try to learn the basics of C# before diving in. Here's an example to remove East and North coordinates from continuation text in the current drawing (minimally tested):

	
// Note: there are a few custom methods below but hopefully you get the gist
public static void RemoveContinuationXyCoords()
	{
		Document doc = MiscTools.GetActiveDoc(); if (doc == null) return;
		Editor ed = doc.Editor;
		Database db = doc.Database;

		string nl = Environment.NewLine;

		// select all MText
		TypedValue[] tvArray = new TypedValue[1];
		tvArray.SetValue(new TypedValue((int)DxfCode.Start, "MTEXT"), 0);
		ObjectIdCollection idColl = MiscTools.GetObjIdColl(ref ed, true, tvArray);

		using (DocumentLock docLock = doc.LockDocument())
		{
			using (Transaction tr = db.TransactionManager.StartTransaction())
			{
				// iterate each MTEXT
				foreach (ObjectId id in idColl)
				{
					List<string> origCoordStrParts = new List<string>();
					string newCoordStr = "";

					try
					{
						// Get the contents string
						MText coordsMtext = tr.GetObject(id, OpenMode.ForRead) as MText;
						string coordsStr = coordsMtext.Text;

						// skip non-continuation mtext - starts with 'E ' or 'N '. Change to suit needs.
						if (!coordsStr.Contains("E ") || !coordsStr.Contains("N ") || !coordsStr.Contains("EL "))
							continue;

						// split parts and recombine with newline character
						char[] delimiters = new char[] { '\r', '\n' };
						origCoordStrParts = coordsStr.Split(delimiters, StringSplitOptions.RemoveEmptyEntries).ToList<string>();
				  
						foreach (string origCoordStrPart in origCoordStrParts)
						{

							// skip x & y coords
							if (origCoordStrPart.StartsWith("E ") || origCoordStrPart.StartsWith("N "))
								continue;
							else
								newCoordStr += origCoordStrPart + nl;
						}
						newCoordStr = newCoordStr.Trim();

						coordsMtext.UpgradeOpen();
						coordsMtext.Contents = newCoordStr;

					}
					catch
					{
						System.Windows.MessageBox.Show("Error setting coordinates mtext.");
					}
				}

				tr.Commit();
			}// end transaction
		}// end doc lock
	}

 

To process multiple drawings with .net, you'd need to open them in the interface or as side databases to process them.

 

 

 

 

 

Message 10 of 15
Garrett.Brothers
in reply to: h_eger

Hello Hartmut ( @h_eger ),

 

Have you learned anything at the meeting with the developers?

Message 11 of 15
h_eger
in reply to: Garrett.Brothers

Unfortunately, this is not good news, development is sticking to the PCF specification at this point and will not change this.

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



Message 12 of 15

I finally realized where I was still confused!  I thought I could add something like <EngineeringItems.Position Z> to the connection/continuation tags to show elevation another way.  The problem I failed to realize was Position Z isn't the same as connection elevation.  If they were the same, we could use a property to add in the elevation separately.  Indeed, there are no properties that dependably match the elevation we need on an iso.  A very silly mistake, I don't know how I confused the two.

I'm finally done with this question (unless I learn how to script the answer like Jabowabo/Jason suggests, in which case I'll post that here).

 

 

Below is my process.  Read it if you want, but it's not important.

I started with a rather plain iso.

gbrothersGETDK_0-1614980159935.png

In project setup, I added this property to the connections and continuations box for equipment:

<EngineeringItems.Position Z>

and this for other connected pipelines:

<PipeRunComponent.Position Z>

gbrothersGETDK_4-1614981225421.png

Note I added a few other properties, but that's not important to this example.  I also turned off coordinates.

 

I got this result:

gbrothersGETDK_1-1614980832469.png

These elevations are inaccurate; neither one matches the elevation show on the original iso.

The 40 on the equipment elevation comes from the equipment properties itself.

gbrothersGETDK_2-1614980955782.png

I do not know why it is 40.

Meanwhile, the elevation for the other end (98") is the COP of the tee it connects to.

gbrothersGETDK_3-1614981108580.png

Message 13 of 15

Just so I personally get an understanding of this, what's the benefit?

Message 14 of 15

If by "this" you mean my last reply, there's no benefit for doing what I did.

 

The whole time I was posting, I was under the impression that if we could only get properties to show up on the connection/continuation text, we could show elevation like we wanted to.  I didn't want to have another novice like me catch on to that and be left confused when the idea was never addressed.  My last post is simply explaining what my idea was and why it wouldn't work.

Message 15 of 15

It must be possible. How is it that we can get ONLY pipeline elevation at elevation changes? This means there is a mechanism that makes that property come out on the iso. In this case is when there is a change in a property.

 

The question I have is, how can we get that same property to come out when we change sheets? 

 

Thanks,

Erin

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report