The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Drawing Objects

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
nac Posted - 09/29/2000 : 8:50:00 PM
Can I create a LabTalk script to draw a circle centred on a given co-ordinate on a plot? I can draw a circle manually, but I want to automatically draw a circle, whose radius is dependent on the data.
3   L A T E S T    R E P L I E S    (Newest First)
nac Posted - 10/02/2000 : 8:58:00 PM
Thanks. Out of interest, you can specify the object's width and height in axes units by using object.dx and object.dy.

I don't suppose you can do the same thing without the need of having the object saved to a file?

Mike Buess Posted - 10/02/2000 : 3:47:00 PM
I forgot about the object.dx,dy properties. Yes, they should work nicely.

The only reason for saving the circle to an object file is that there is no way (that I know of) to create a circle from scratch with script commands. If you draw a circle and save it to file you can use it as often as you like.

-Mike

Mike Buess Posted - 09/29/2000 : 1:11:00 PM
You should be able use the draw command along with object properties to do this. I'll outline how I would go about it and you can consult your LabTalk help file for details ("draw" command and "User-created Visual Objects" topic).

First, use the Circle Tool to draw a circle in an empty plot window. Don't worry about its size or even if its a perfect circle, but you can edit its other properties (color, line width, etc.) if you wish. Then right click on the circle, select Object Control and give it a name if it doesn't already have one. (I'll just call it "circle".) Save it as an object file by opening the script window and entering the command:

draw -n circle -f save circle;

Open another plot window and retrieve the circle with the command:

draw -n circle -f read circle;

Use its object properties to position and size the circle. The following script line places the center of the circle at X=5 and Y=10 in axes units:

circle.x=5; circle.y=10;

The next line sets the diameter of the circle to 500 in layer units:

circle.width=500; circle.height=500;

I'm not sure off the top of my head how to convert from layer units to axes units, but there must be a way. You'll find several other object properties that can be changed with script commands.

-Mike


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000