Diesel in MTEXT to list xrefs

Diesel in MTEXT to list xrefs

Haider_of_Sweden
Collaborator Collaborator
2,267 Views
14 Replies
Message 1 of 15

Diesel in MTEXT to list xrefs

Haider_of_Sweden
Collaborator
Collaborator

I got plenty of xrefs which causes the RTEXT that is used in the sheet block to go beyond the sheet edge.

From what I understand, RTEXT doesn't support multi-line. That leaves me MTEXT.

 

The diesel function used in RTEXT: $(XREFS,8,  ,)

 

I believe this problem is because a remnant from a time when files had 8 characters at max, but today you can have long filenames which gives you a really long list of xrefs 😀 

 

Any clue what I should do to make this work?

2,268 Views
14 Replies
Replies (14)
Message 2 of 15

pendean
Community Legend
Community Legend
Q: have you had a chance to start FIELD command yet to create what you seek? I believe this is what you are looking for.

Message 3 of 15

vinodkl
Mentor
Mentor

Hi,

 

You can use field to enter your diesel function which will be a mtext.

Type in the command "FIELD" and then select the field category "other" and then select field name "diesel expression" and then enter your diesel expression on the right side.

vinodkl_0-1591764756711.png

 

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
0 Likes
Message 4 of 15

cadffm
Consultant
Consultant

@vinodkl 

And your Program can handle extendet RText-Diesel expressions like XREFS ?

Wow, never saw that before, all my Versions are able to handle native Diesel functions only.

Sebastian

Message 5 of 15

vinodkl
Mentor
Mentor

Hi, 

 

Apologies @cadffm. I had not tested it😅 and you are right. xref function do not work in field and I stand corrected. I had used diesel expression with other function like GETVAR it worked very well. I did know that the function "GETPROP" would not work in field, but I didn't know that xref wouldn't work as well😅

 

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
0 Likes
Message 6 of 15

Haider_of_Sweden
Collaborator
Collaborator

I just tried fields with the XREFS before reading the last reply.

 

So it doesn't work with field then?

What else can I investigate?

 

Does RTEXT support linebreaks? is there a way to read the length of the RTEXT and break the line?

0 Likes
Message 7 of 15

pendean
Community Legend
Community Legend
No automatic line-breaks in RTEXT, you'll need to add them manually.

How to do it with FIELDs as a workaround https://forums.autodesk.com/t5/civil-3d-forum/line-break-in-fields/m-p/3084284#M155858

Or start widening that box in your titleblock.

HTH
0 Likes
Message 8 of 15

Haider_of_Sweden
Collaborator
Collaborator

@pendean wrote:
No automatic line-breaks in RTEXT, you'll need to add them manually.

How to do it with FIELDs ...

But it seems like the usage of XREFS and diesel isn't compatible with FIELDS, is it?

At least I couldn't manage to make it work.

 

please see screenshot

 

FIELD vs RTEXT.jpg

 

Could there be a workaround, using LISP or similar, to read out the XREFS and fill in an MTEXT?

Maybe a workaround like this would require REGEN or re-running the LISP before PLOT, but still, it would be better than having the Xrefs going beyond paperspace.

 
0 Likes
Message 9 of 15

cadffm
Consultant
Consultant

Fields can not use the Rtext-DieselExtension, just native Diesel functions will work with fields.

Xrefs" is an Rtext DieselExtension, so it will not work.

 

 

API (VBA LISP .Net and more)

Sure, a tool to do this is possible, 1000 times in use

and i am sure you will find samples.

 

 

Sebastian

0 Likes
Message 10 of 15

Haider_of_Sweden
Collaborator
Collaborator

@cadffm wrote:

API (VBA LISP .Net and more)

Sure, a tool to do this is possible, 1000 times in use

and i am sure you will find samples.


I am afraid I haven't 😞

If you can push me in the right direction, I would be very grateful. I am not even sure what proper keyword I should be looking for, to find anything, free or paid tools that can read Xrefs and print them out for you on a sheet.

0 Likes
Message 11 of 15

cadffm
Consultant
Consultant

Use this RTEXT-DIESEL  expression: $(XREFS,8)

Sebastian

0 Likes
Message 12 of 15

Haider_of_Sweden
Collaborator
Collaborator

@cadffm wrote:

Use this RTEXT-DIESEL  expression: $(XREFS,8)


That's how I do today.

Unfortunately, I have a large amount of Xrefs plus they have long filenames and therefore the line exceeds far beyond the paper edge.

 

That's why I was looking for alternatives. Too bad Fields doesn't support XREFS, nor does MTEXT.

If someone knew a LISP-method to fill an MTEXT with all Xrefs, that could work better than the solutions available today.  

 

Otherwise, we'll have to admit defeat on this one 😞

0 Likes
Message 13 of 15

cadffm
Consultant
Consultant

Sorry, but this is not what you use today.

Copy my posted expression, try it, then write a new answer.

😉

Sebastian

0 Likes
Message 14 of 15

Haider_of_Sweden
Collaborator
Collaborator

Thanks for your patience with me. You are right of course, the code looked rather similar but wasn't identical.

 

Interesting approach!

Maybe I would need to adjust the drawing layout to fit the Xrefs nicely into the sheet.

Also, I realize my initial question can be interpreted differently. You solved this perfect to meet the multi-line demand, while what I had in mind was an MTEXT or behaviour like MTEXT: a given column width and a bottom-left justification so that the Xrefs could be listed one after another and when there is no room, they continue below, and thanks to the justification setting, the text would grow upwards.

 

Here is a screen capture of my problem:

Haider_of_Sweden_0-1592663295481.png

 

Again, with the solution you provided, I would need to layout the drawing differently. The result would be better than what I have today because I can present all the Xrefs, which I couldn't before as demonstrated in the screenshot.

 

But what do you think about the MTEXT approach? Is this doable? Either fully automatically or manually (LISP to push text into an MTEXT or similar)?

 

 

   

0 Likes
Message 15 of 15

cadffm
Consultant
Consultant

MTEXT fields

XREFS is not a native DIESEL function, it comes from the addon RTEXT,

What is 20 Years old (no FIELDS available 20years ago)

Field-DIESEL works only with native DIESEL funktions.

 

 

LISP

As i wrote: Possible

But this wanted function need to know where to add the information,

also it is a good thing that the program run all the time (to update the information).

 

This all needs to ask you some informations, 

More better the program, more time needed. 

Nothing for me, Ready4use programs, i usually write this only for my own use,

but perhaps you will find another helper.

GoodLuck

 

Sebastian

Sebastian