parkerbelt
Active Member
- Joined
- May 23, 2014
- Messages
- 377
I'm trying to write a program for Space Planning - Space Automation Pro and I can't seem to get the syntax correct to do what I want to do. Here is the code that I'm trying:
I'm trying to check the Description 21 field to see if it is blank and if so, delete the position from the Planogram.
There aren't any resources to look for Space Automation Pro syntax, but I thought that since this code is Visual Basic, someone on here might be able to tell me how to correct my syntax.
Visual Studio doesn't like my comma after Desc21 and the first quote has the red squiggly line under it too. When I run my cursor over the comma, intelisense says ')' expected and when I run the cursor over the first quote, it says Named argument expected.
I've tried putting in a ) and tried putting in Equals "" and a number of other things, but can't get the syntax just right.
Anyone have a clue what I should do?
Thanks!
Here's what the help section shows for Syntax:
[h=2]ForPositions[/h]This loop performs actions for all positions on the active planogram. You can use the WhereCondition parameter to identify specific positions to be processed by the commands in the loop.
Note: If you include commands that refer to the ProductKey in this loop and multiple positions of the selected products exist on the active planogram, care should be taken to ensure the proper positions are modified by the commands.
Syntax
For Each Var as Space.Position In SpacePlanning.ForPositions(WhereCondition as String)
Next
Var
Var is a variable of type Space.Position.
WhereCondition (optional)
String. For applicable loops, specifies the criteria used to filter the objects that are processed by commands in the loop. For the SelectObjects and DeselectObjects commands, specifies the criteria used to filter the objects that are selected or deselected.
Example: Modify positions on a planogram
Classic style scripting
SpacePlanning.OpenProjectFile("C:\Program Files (x86)\JDA\Intactix\Samples\Space Planning Planograms\Sample - Coffee Makers.psa")
For Each Posi As Space.Position In SpacePlanning.ForPositions("X = 0")
Posi.SetPositionField(SpacePositionFields.Angle, 10)
Next
Instance style scripting
Dim SpProj As Space.Project
Dim SpPlano As Space.Planogram
SpProj = SpacePlanning.OpenProjectFile("C:\Program Files (x86)\JDA\Intactix\Samples\Space Planning Planograms\Sample - Coffee Makers.psa")
SpPlano = SpProj.SetActivePlanogram(0)
For Each Posi As Space.Position In SpPlano.Positions()
Posi.SetPositionField(SpacePositionFields.Angle, 10)
Next
Code:
For Each Posi As Space.Position In SpacePlanning.ForPositions(WhereCondition:=(SpaceProductFields.Desc21, ""))
'SpacePlanning.SelectPosition()
SpacePlanning.CutToClipboard()
DeleteCount = DeleteCount + 1
Next
I'm trying to check the Description 21 field to see if it is blank and if so, delete the position from the Planogram.
There aren't any resources to look for Space Automation Pro syntax, but I thought that since this code is Visual Basic, someone on here might be able to tell me how to correct my syntax.
Visual Studio doesn't like my comma after Desc21 and the first quote has the red squiggly line under it too. When I run my cursor over the comma, intelisense says ')' expected and when I run the cursor over the first quote, it says Named argument expected.
I've tried putting in a ) and tried putting in Equals "" and a number of other things, but can't get the syntax just right.
Anyone have a clue what I should do?
Thanks!
Here's what the help section shows for Syntax:
[h=2]ForPositions[/h]This loop performs actions for all positions on the active planogram. You can use the WhereCondition parameter to identify specific positions to be processed by the commands in the loop.
Note: If you include commands that refer to the ProductKey in this loop and multiple positions of the selected products exist on the active planogram, care should be taken to ensure the proper positions are modified by the commands.
Syntax
For Each Var as Space.Position In SpacePlanning.ForPositions(WhereCondition as String)
Next
Var
Var is a variable of type Space.Position.
WhereCondition (optional)
String. For applicable loops, specifies the criteria used to filter the objects that are processed by commands in the loop. For the SelectObjects and DeselectObjects commands, specifies the criteria used to filter the objects that are selected or deselected.
Example: Modify positions on a planogram
Classic style scripting
SpacePlanning.OpenProjectFile("C:\Program Files (x86)\JDA\Intactix\Samples\Space Planning Planograms\Sample - Coffee Makers.psa")
For Each Posi As Space.Position In SpacePlanning.ForPositions("X = 0")
Posi.SetPositionField(SpacePositionFields.Angle, 10)
Next
Instance style scripting
Dim SpProj As Space.Project
Dim SpPlano As Space.Planogram
SpProj = SpacePlanning.OpenProjectFile("C:\Program Files (x86)\JDA\Intactix\Samples\Space Planning Planograms\Sample - Coffee Makers.psa")
SpPlano = SpProj.SetActivePlanogram(0)
For Each Posi As Space.Position In SpPlano.Positions()
Posi.SetPositionField(SpacePositionFields.Angle, 10)
Next
Last edited: