Hi Bob,
Can you suggest how to achieve the below mapbasic example using a DO in python. How are you able to reference the Selection.
'// Select all records with a map object
Select * from mybigtable where obj into ToUpdate
'// Update your selection table
Update ToUpdate Set obj = UpdatePenStyle(obj, newPen)
'================================================================
'// Update the pen style of an object
'----------------------------------------------------------------
Function UpdatePenStyle(ByVal updObject as Object, ByVal newPen as Pen) as Object
Alter Object updObject Info OBJ_INFO_PEN, newPen
UpdatePenStyle = updObject
End Function
I currently use the below to select data, how do I reference the resulting selection to update the pen style.
do("select * from Grader_Jobs_To_Current where gang_code = \"" + gangCode + "\" AND disp_year = \"" + str(dispYear) + "\" into " + selectName + " noselect".format(table.Alias))
Thanks
------------------------------
Stephen Perger
Buloke Shire Council
Wycheproof VIC
------------------------------
Original Message:
Sent: 07-16-2021 14:50
From: Bob Fortin
Subject: MakePen() equivalent in Python
Hi Stephen,
As not all pro functionality is covered in python yet, somethings you need to resort to mapbasic to get things done.
You can use do() or eval() to execute mapbasic statements.
If you need more details let me know.
-Bob
------------------------------
Bob Fortin
Software Architect and Distinguished Engineer
MapInfo Pro Development Team
Original Message:
Sent: 07-15-2021 21:39
From: Stephen Perger
Subject: MakePen() equivalent in Python
Hi,
trawling through all the python samples and knowledge communities I cannot seem to find an example of updating object styles.
I have a SQL selection that I want to then update the object style.
Suggestions or examples appreciated
------------------------------
Stephen Perger
Buloke Shire Council
Wycheproof VIC
------------------------------