Support Forum

Programatically setting the width of a Path

John

Thursday 20th June 2019
I am using C++ Script to generate layout. In particular, I'm creating a bezier3 type Path with the following code segment: layout->drawing->activeLayer=layer; setup::defaultPathWidth=element::round(width*1000); /* Convert width to dbu */ layout->drawing->clearPoints(); layout->drawing->point(pStart.point(i).x(), pStart.point(i).y()); /* Start */ layout->drawing->point(pEnd.point(i).x(), pEnd.point(i).y()); /* End */ layout->drawing->point(pMid.point(i).x(), pMid.point(i).y()); /* Start-direction */ layout->drawing->point(pMid.point(i).x(), pMid.point(i).y()); /* End-direction */ layout->drawing->bezier3(); Setting setup::defaultPathWidth prior to creating the Path still results in a zero-width Path created in the database. Is there a way to Select each newly-created Path and change it's Width? Thanks.
J├╝rgen
LayoutEditorFull
Friday 21st June 2019
The bezier feature should respect the default width. That will be fixed with the next update. Anyway you can adjust the path width of the last created shape with this line of code: ``` layout->drawing->currentCell->firstElement->thisElement->setWidth(100); ``` The last created element is always the first element in the element list.