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 for Programming
 LabTalk Forum
 Several problems with graphical 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
asenv Posted - 10/13/2010 : 08:00:17 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.1G SR3
Operating System: Windows 2000 Pro

I have several problems with gobjects. On the picture below I want to get the lower gobject with labtalk commands.



1 I want to set the color of the gobject to transparent:
gobjectname.fillcolor =0;
or
gobjectname.fillcolor =color(none);


As you can see on the upper gobject it is actually set as transparent when I check this with the gui, but it shows as black. If I set it with the gui it works.

2 I want to remove (set to 0 width) the border/frame (Rahmen Tab) lines of the gobjects. The ones that are in red on the upper gobject.
I tried gobjectname.lineWidth=0; and gobjectname.lineType=0;, but I get this error: object property not found!

3 I want to set the fill pattern (which with the gui works).
I have done that for a layer with the set command like: set datasetname/worksheetname -pfp 1;. This did not work form for gobject, because gobject is other data type.

Regards,
Asen
3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 12/14/2010 : 10:20:15 AM
Watching the tree in debug revealed that -4 is the transparent color code. After a few tests, I found that this works:

rect.fillcolor = 2^32 - 4;

Most graphic objects have only limited LabTalk access, so use rdremov's code as an example of working around that problem.
asenv Posted - 10/14/2010 : 06:49:30 AM
Thank you very much, the function does its job prefectly well. Just for the other people that read the topic I will say that in labtalk I load the function with
run.LoadOC("path_to_*.c_file",2);

and execute the functions inside the *.c file just with writing the function name - somefunction;
rdremov Posted - 10/13/2010 : 4:52:23 PM
Here is OC functin which should do the job:

void change_rect_fill(string strName = "Rect")
{
	GraphLayer gl = Project.ActiveLayer();
	GraphObject go = gl.GraphObjects(strName);
	
	Tree tr;
	tr.Root.Border.Width.dVal = 0;						// no border
	tr.Root.Fill.Color.nVal = INDEX_COLOR_TRANSPARENT;	// no fill color
	tr.Root.Fill.Pattern.Style.nVal = 3;				// sparse diagonal
	tr.Root.Fill.Pattern.Width.dVal = 1;				// pattern width
	tr.Root.Fill.Pattern.PatternColor.nVal = 0;			// black pattern color
	int err = go.UpdateThemeIDs(tr.Root, "Error", "Unknown tag");
	go.ApplyFormat(tr, true, true);
	
}

It is based on theme properties access.

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