smbNewGridPos

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.0, Creation date: 2016-11-18, Last change: 2025-09-14

return grid positions for new blocks

Description

This auxiliary function helps to create new SimMechanics block at grid positions.
Since Dec. 2016, the function analyzes the current systems and uses the next free grid position

See Also: smbPosgcb , smbSetPosition

Example Illustration

 missing image of smbNewGridPos(Nr,Grid,Colum)

Syntax

[p,Np]=smbNewGridPos([Nr,Grid,Colum])

Input Parameter

Nr: Current number of Grid position; default is 0
Grid: Grid size; default is [100 100]
Colum: Number of columns; default is 5

Output Parameter

p: [x y] of a grid
Np: Number in the grid

Examples


smbNewGridPos (0) % resets the Grid Position number return 100 100
smbNewGridPos % return 200 100
smbNewGridPos % return 300 100




Copyright 2016-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21