Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FIELDS, using coordinates of UCS

20 REPLIES 20
SOLVED
Reply
Message 1 of 21
XXL1966
9414 Views, 20 Replies

FIELDS, using coordinates of UCS

Hello,

 

I have a function that add's an Mtext to a block that refers to a field with the insertion coordinates. This works fine in WCS.

However is there a way to control the field so the UCS coordinates of the block are used (like using function trans) instead of WCS ?

 

ty !

20 REPLIES 20
Message 2 of 21
phanaem
in reply to: XXL1966

You can use a formula instead of Position property of the block. In the formula field you can use any function available for CAL function.

For Ucs transformation, the function is W2U(p). So you will have a Formula containing the function W2U. For the point, insert another field in the formula, select the object and pick Position property.

See the attachement for example.

 

Message 3 of 21
XXL1966
in reply to: phanaem

awesome ! many thx !

Message 4 of 21
rigid_joint
in reply to: phanaem

Thank you very much for the tip. But I have a question. If I want only one data e.g. the X values , then it returns ######## strings. Any idea how will it work?
Message 5 of 21
F.Camargo
in reply to: rigid_joint


@rigid_joint wrote:
Thank you very much for the tip. But I have a question. If I want only one data e.g. the X values , then it returns ######## strings. Any idea how will it work?

@phanaem

 

Hi @rigid_joint I have the same question. I can't put only x or y value.

 

e.g.JPG

Message 6 of 21
phanaem
in reply to: F.Camargo

Hi

In my sample above, the block contain 2 attributes, one for WCS point and one for UCS point.

Edit the attribute and double click on the field.

For the WCS, in the dialog box check only the component you want (X, Y or Z)

For the UCS, use one of the following function: rxof for X component, ryof for Y or rzof for Z. Now the formula should look like:  rxof(w2u(x, y, z))

 

 

Message 7 of 21
F.Camargo
in reply to: phanaem


@phanaem wrote:

Hi

In my sample above, the block contain 2 attributes, one for WCS point and one for UCS point.

Edit the attribute and double click on the field.

For the WCS, in the dialog box check only the component you want (X, Y or Z)

For the UCS, use one of the following function: rxof for X component, ryof for Y or rzof for Z. Now the formula should look like:  rxof(w2u(x, y, z))

 

 


Thank you @phanaem

 

Worked perfect!!

Message 8 of 21
vferrara
in reply to: F.Camargo

I have tried to do this procedure and am having trouble getting it correctly.  I have attached a screen shot of what I did for your reference...!

 

Thank you in advance for you assistance...!

 

 

Vince

Message 9 of 21

Can anyone help with just having x,y coordinates for the UCS version

 

I can turn off Z foe WCS  & using the rxof I can have just x, y or z

 

Just can't seem to get x&y together with no z

 

Thanks

Message 10 of 21

Hi

 

You can use a mix of simple texts and fields for the attribute value.

It can be like this: UCS = [field_x], [field_y]

[field_x] is like: rxof(w2u([field_position]))

[field_y] is like: ryof(w2u([field_position]))

 

UCS Fields.gif

Message 11 of 21

Thanks

 

That's just the job

Message 12 of 21
vferrara
in reply to: XXL1966

Hi,

I created a block containing 2 attributes with fields to read the X & Y coordinates of the blocks insert point (see attached block). This block works fine in the World UCS system or alternate UCS systems created on that drawing. However, I have encountered a problem when the block is used on drawings that contain multiple UCS systems that need to be displayed at the same time, which is common on many of our projects. For Example......lets say we have the "World" UCS system and 2 alternate UCS systems I will call UCS "A" and UCS "B" and these blocks inserted in all of these UCS systems. When the block is inserted in the "A" UCS system the coordinates initially display correctly and when the block is inserted in the "B" UCS system the coordinates initially display correctly but after they are placed on the drawing......all of the blocks will only display the coordinates of the "current" UCS system.

How can I get the coordinate display for the blocks inserted in each coordinate system ("World" - "A" - "B") to only display the coordinate values for the corresponding UCS system they were inserted under.


Thank you in advance for your assistance..!!

Vince

Message 13 of 21

This is such a helpful visual. it also works exactly as I want.

 

However, I want to implement this from the tool palette so its default value of the attribute is already carrying the formula ready to go. At the moment, I have to have a block set up basically like you have with an attribute where I can manually enter field requirement at the start of every drawing (after inserting into model space).

 

Is there any way to have it set as the default value within the block to check it's own insertion point, rather than entering the field and following these steps after insertion into model space. I want to be able to stick the block in a folder and have anyone in my team just drop it in to show the coordinates, rather than have to get each person to manually enter it each time.

Message 14 of 21
cadrrg
in reply to: vferrara

Were you able to solve the issue with the coordinate switching when changing to an alternate UCS?

Message 15 of 21
davidlacko
in reply to: phanaem

Hello, just looking for a solution on this topic. In your file the UCS and WCS coordinates are ok in model space, but in paper space they are both the same (based on WCS, I guess). How to set up paper space to see those UCS coordinates, which are shown in model space? Thank you.

Message 16 of 21

Change from WCS to the same UCS in paper space as you use in model space with the command UCSMAN.

Message 17 of 21
gcandido
in reply to: phanaem

Hi,

 

What a great solution.

This solution extract the UCS coordinates based on the UCS used.

Is it possible to get the UCS coordinates from all UCS created in the drawing? (One attribute for each UCS)

 

Thanks,

Gonçalo

Message 18 of 21
g.korpershoek
in reply to: gcandido

HI,

 

The solution works great. Thanks. I'am still struggling with the Paperspace

Message 19 of 21
gvborre
in reply to: g.korpershoek

I can't.

I would like when I work anywhere in a UCS coordinate system or in a WCS that I can see the coordinates in that coordinate system that is selected.

Message 20 of 21
aosrom
in reply to: F.Camargo

Hi,

Where these functions are documented?

Have a nice day!

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

Post to forums  

Autodesk Design & Make Report

”Boost