To solve this optimization problem, we first need to define the decision variables and the objective function. Let's denote the number of ice cream cones as `x` and the number of ice cream cups as `y`. The objective is to maximize revenue, which can be calculated based on the revenues per unit of each product.

The constraints are based on the availability of scoops of ice cream and grams of toppings. For ice cream cones, each requires 3 scoops, and for ice cream cups, each requires 4 scoops. Similarly, for toppings, each cone requires 5 grams, and each cup requires 6 grams.

Given:
- Each ice cream cone requires 3 scoops of ice cream.
- Each ice cream cup requires 4 scoops of ice cream.
- The truck has available 500 scoops of ice cream.
- Each ice cream cone requires 5 grams of toppings.
- Each ice cream cup requires 6 grams of toppings.
- The truck has available 1000 grams of toppings.
- Revenue per ice cream cone is $3.
- Revenue per ice cream cup is $3.50.

The optimization problem can be formulated as follows:

Maximize: \(3x + 3.5y\)

Subject to:
1. \(3x + 4y \leq 500\) (ice cream scoops constraint)
2. \(5x + 6y \leq 1000\) (toppings grams constraint)
3. \(x, y \geq 0\) (non-negativity constraints)

This formulation ensures that the truck does not use more resources than available and maximizes its revenue by deciding how many ice cream cones and cups to sell.

```python
from gurobipy import *

# Create a model
m = Model("Ice Cream Optimization")

# Define decision variables
x = m.addVar(vtype=GRB.CONTINUOUS, name="ice_cream_cones")
y = m.addVar(vtype=GRB.CONTINUOUS, name="ice_cream_cups")

# Objective function: Maximize revenue
m.setObjective(3*x + 3.5*y, GRB.MAXIMIZE)

# Constraints
m.addConstr(3*x + 4*y <= 500, "ice_cream_scoops")
m.addConstr(5*x + 6*y <= 1000, "toppings_grams")

# Solve the model
m.optimize()

# Print solution
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Sell {x.x} ice cream cones")
    print(f"Sell {y.x} ice cream cups")
    print(f"Max Revenue: ${3*x.x + 3.5*y.x}")
else:
    print("No optimal solution found")

```