EDA365电子论坛网

标题: share skill [Add symbol] [打印本页]

作者: EDAstudent365    时间: 2019-11-2 11:42
标题: share skill [Add symbol]

x_loc=nil

y_loc=nil

mir=nil

rot=0



axlCmdRegister( "add_sym" 'add_symbol ?cmdType "interactive")



defun(add_symbol (symb type)



;get design extents



case( type

   ( "p"

    type = "package"

   )

   ( "m"

     type = "mechanical"

   )

   ( "f"

     type = "format"

   )

   ( t

      printf("%s is not a legal symbol type. Use p m or f.\n" type)

   )

);endcase



position=axlEnterPoint()

x_loc=car(position)

y_loc=cadr(position)



place=axlDBCreateSymbol(list(symb type) x_loc:y_loc mir rot)



        if(place==nil then

                printf("Placement of symbol %s failed.\n" symb)

        else

                if(cadr(place)!=nil then

                        printf("DRC errors created when placing %s.\n" symb)

                ); end if cadr(place)

        );end if place1



);end defun add_symbol



作者: davidquan73    时间: 2019-11-21 17:13
thanks, great code




欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2