Jump to content

Existing Tree Image in schedule


Recommended Posts

Am thinking if we could import the jpeg as a bitmap and name the object acording to the tree number we could link the two in worksheets to get the image in the applicable row. Is there a code/function that can be used to identify the same text?

image.png.92a2e9fd5f43a27c4226fed965a70e29.pngimage.png.cd80a09fe63c1bc8d23e164a5d7d4578.png

Link to comment

The closest work around you are going to get is to use a Worksheet Script and make the images symbols.

 

Make a new Vectorscript from the script below and name it ReturnSymbolImage.

 

The script takes the Record and Field name that hold a symbol name and returns an image of that symbol to the worksheet.

 

If you import you images and make symbols that are names with the Existing Tree number you should get what you are looking for.

 

The worksheet formula would be:

 

=RunScript('ReturnSymbolImage','Existing Tree','Tree No')

 

You can use any Record.Field combination that is attached to the object in the database subrow to hold the symbol name. For example if you wanted to have both Summer and Winter images you could store the symbol names in the Field9 and Field10 fields of the Existing Tree record and then just change the last piece of text in the above formula to 'Field9' or 'Field10' as appropriate. Or put them in different columns and use both.

 

Procedure ReturnSymbolImage;

{©2023  Pat Stanford - pat@coviana.com}
{licensed under the Boost Software License 1.0}
{https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt}
{TL/DR Use as you want, attribution for source, No warranty}

{Takes the user supplied Record and Field names}
{and returns and image of the symbol name contained}
{in the field to the database cell for the Object}
{the record is attached to}

Var		H1, H2		:Handle;
		S1			:String;

BEGIN
	H2:=WSScript_GetObject;
	S1:=GetRField(H2, WSScript_GetPrmStr(0), WSScript_GetPrmStr(1));

	H1:=GetObject(S1);
	WSScript_SetResImage(H1);
	
End;

Run(ReturnSymbolImage);

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...