Quantcast
Channel: Cadence PCB Skill Forum
Viewing all articles
Browse latest Browse all 2157

Allegro crashes opening a new design after Skill routine uses axlEnterPoint

$
0
0

Hi, I have written a routine to output the min track, gap and annular ring values etc which works ok. It will happily update text on drawing layers if they exist already. If the text does not exist the user is prompted for a position for the new data. This is where the problem starts. All seems ok and the design checks out and can be saved. However, if I try to open another design Allegro crashes and creates a .sav file in the directory of the other design or symbol. Just to be clear, there is never a problem if the text to be updated is alredy in the design, only when there is a prompt for position. Here is a snippet:

layer_count = length(axlGetParam("paramLayerGroup:etch")->groupMembers)
l_text = axlGetSelSet()
        foreach(text_t l_text
                when(text_t->text
                    if(rexMatchp("^Number of LAYERS.*$" text_t->text) ; Lower case writing on is on layer Outline.
                    then
                    layno_xy = text_t->xy
                    layCountText = sprintf(nil, "%n", layer_count )
                    newText = strcat("Number of LAYERS:", " ", layCountText )
                    replaceText(text_t newText)
                        ) ;end if
                    ) ; when
                ) ; end foreach

                        unless(layno_xy
                            axlSetActiveLayer("DRAWING FORMAT/DRILL")
                            axlVisibleDesign(nil)  axlUIWUpdate(nil)
                            axlVisibleLayer("DRAWING FORMAT/DRILL" t)
                            axlVisibleUpdate(t)
                            axlClearSelSet() axlAddSelectAll()
                            l_text = axlGetSelSet()

                            foreach(text_t l_text
                                    when(text_t->text
                                        if(rexMatchp("^NUMBER OF LAYERS.*$" text_t->text)
                                        then    
                                        layno_xy = text_t->xy
                                        textOrientNumLayDrill = axlTextOrientationCopy(text_t)
                                        axlDeleteObject(text_t)
                                            ) ; end if
                                        ) ; when
                                     ) ; end foreach

                                unless(layno_xy
                                    layno_xy = axlEnterPoint(?prompts list("Pick Number of layers TEXT POSITION:"))
                                    textOrientNumLayDrill = defaultOrient
                                    ) ; end unless
                             ) ; end unless

                    when( textOrientNumLayDrill
                 axlDBCreateText(sprintf(nil "NUMBER OF LAYERS: %n" layer_count), layno_xy,
                                                textOrientNumLayDrill, "DRAWING FORMAT/DRILL", nil)
                        ) ; when

Any ideas ?

Jim O'Mahony


Viewing all articles
Browse latest Browse all 2157

Trending Articles