Цитата: paparazzo, а можете привести примеры ваших макросов?)
К сожалению нет...
Те что писал по заказу - запрещено показывать еще 3 года.
Те что для себя - для расчета осветителей и т.п., слишком специфичны.
Редактор - ConText Editor, он понимает команды zpl и выделяет разным цветом
Но могу лично для вас написать
Добавлено: хотя вот, попроще
Код: !
INPUT "Введите номер объекта ", obj
INPUT "Введите новое количество точек (от 3 до 40) ", Nnew
INPUT "Enter parameter # start", STRT_PAR
STRT_PAR=STRT_PAR-1
INPUT "Enter initial points number", Nold
dummy = NPRO(1, obj, 1, 0)
a$ = $buffer()
!Nold=NPAR(1,obj,4) #старые точки
length=NPAR(1,obj,6) #длина
DECLARE xa,DOUBLE,1,Nold+1
DECLARE bz, DOUBLE,1,40
FOR i,1,Nold,1
xa(i)=NPAR(1,obj,i+STRT_PAR)
PRINT xa(i)
NEXT i
PAUSE
IF (Nold == 3)
bz(1) = 1
bz(2) = 2
bz(3) = 1
ENDIF
IF (Nold == 4)
bz(1) = 1
bz(2) = 3
bz(3) = 3
bz(4) = 1
ENDIF
IF (Nold == 5)
bz(1) = 1
bz(2) = 4
bz(3) = 6
bz(4) = 4
bz(5) = 1
ENDIF
IF (Nold == 6)
bz(1) = 1
bz(2) = 5
bz(3) = 10
bz(4) = 10
bz(5) = 5
bz(6) = 1
ENDIF
IF (Nold == 7)
bz(1) = 1
bz(2) = 6
bz(3) = 15
bz(4) = 20
bz(5) = 15
bz(6) = 6
bz(7) = 1
ENDIF
IF (Nold == 8)
bz(1) = 1
bz(2) = 7
bz(3) = 21
bz(4) = 35
bz(5) = 35
bz(6) = 21
bz(7) = 7
bz(8) = 1
ENDIF
IF (Nold == 9)
bz(1) = 1
bz(2) = 8
bz(3) = 28
bz(4) = 56
bz(5) = 70
bz(6) = 56
bz(7) = 28
bz(8) = 8
bz(9) = 1
ENDIF
IF (Nold == 10)
bz(1) = 1
bz(2) = 9
bz(3) = 36
bz(4) = 84
bz(5) = 126
bz(6) = 126
bz(7) = 84
bz(8) = 36
bz(9) = 9
bz(10) = 1
ENDIF
IF (Nold == 11)
bz(1) = 1
bz(2) = 10
bz(3) = 45
bz(4) = 120
bz(5) = 210
bz(6) = 252
bz(7) = 210
bz(8) = 120
bz(9) = 45
bz(10) = 10
bz(11) = 1
ENDIF
IF (Nold == 12)
bz(1) = 1
bz(2) = 11
bz(3) = 55
bz(4) = 165
bz(5) = 330
bz(6) = 462
bz(7) = 462
bz(8) = 330
bz(9) = 165
bz(10) = 55
bz(11) = 11 bz(12) = 1
ENDIF
IF (Nold == 13)
bz(1) = 1
bz(2) = 12
bz(3) = 66
bz(4) = 220
bz(5) = 495
bz(6) = 792
bz(7) = 924
bz(8) = 792
bz(9) = 495
bz(10) = 220
bz(11) = 66
bz(12) = 12
bz(13) = 1
ENDIF
IF (Nold == 14)
bz(1)=1
bz(2)=13
bz(3)=78
bz(4)=286
bz(5)=715
bz(6)=1287
bz(7)=1716
bz(14)=1
bz(13)=13
bz(12)=78
bz(11)=286
bz(10)=715
bz(9)=1287
bz(8)=1716
ENDIF
IF (Nold == 15)
bz(1)=1
bz(2)=14
bz(3)=91
bz(4)=364
bz(5)=1001
bz(6)=2002
bz(7)=3003
bz(15)=1
bz(14)=14
bz(13)=91
bz(12)=364
bz(11)=1001
bz(10)=2002
bz(9)=3003
bz(8)=3432
ENDIF
IF (Nold == 16)
bz(1)=1
bz(2)=15
bz(3)=105
bz(4)=455
bz(5)=1365
bz(6)=3003
bz(7)=5005
bz(8)=6435
bz(16)=1
bz(15)=15
bz(14)=105
bz(13)=455
bz(12)=1365
bz(11)=3003
bz(10)=5005
bz(9)=6435
ENDIF
IF (Nold == 17)
bz(1)=1
bz(2)=16
bz(3)=120
bz(4)=560
bz(5)=1820
bz(6)=4368
bz(7)=8008
bz(8)=11440
bz(9)=12870
bz(17)=1
bz(16)=16
bz(15)=120
bz(14)=560
bz(13)=1820
bz(12)=4368
bz(11)=8008
bz(10)=11440
ENDIF
IF (Nold == 18)
bz(1)=1
bz(2)=17
bz(3)=136
bz(4)=680
bz(5)=2380
bz(6)=6188
bz(7)=12376
bz(8)=19448
bz(9)=24310
bz(18)=1
bz(17)=17
bz(16)=136
bz(15)=680
bz(14)=2380
bz(13)=6188
bz(12)=12376
bz(11)=19448
bz(10)=24310
ENDIF
IF (Nold == 19)
bz(1)=1
bz(2)=18
bz(3)=153
bz(4)=816
bz(5)=3060
bz(6)=8568
bz(7)=18564
bz(8)=31824
bz(9)=43758
bz(10)=48620
bz(19)=1
bz(18)=18
bz(17)=153
bz(16)=816
bz(15)=3060
bz(14)=8568
bz(13)=18564
bz(12)=31824
bz(11)=43758
ENDIF
IF (Nold == 20)
bz(1)=1
bz(2)=19
bz(3)=171
bz(4)=969
bz(5)=3876
bz(6)=11628
bz(7)=27132
bz(8)=50388
bz(9)=75582
bz(10)=92378
bz(20)=1
bz(19)=19
bz(18)=171
bz(17)=969
bz(16)=3876
bz(15)=11628
bz(14)=27132
bz(13)=50388
bz(12)=75582
bz(11)=92378
ENDIF
IF (Nold == 21)
bz(1)=1
bz(2)=20
bz(3)=190
bz(4)=1140
bz(5)=4845
bz(6)=15504
bz(7)=38760
bz(8)=77520
bz(9)=125970
bz(10)=167960
bz(21)=1
bz(20)=20
bz(19)=190
bz(18)=1140
bz(17)=4845
bz(16)=15504
bz(15)=38760
bz(14)=77520
bz(13)=125970
bz(12)=167960
bz(11)=184756
ENDIF
PRINT "Pass 21"
IF (Nold == 22)
bz(1)=1
bz(2)=21
bz(3)=210
bz(4)=1330
bz(5)=5985
bz(6)=20349
bz(7)=54264
bz(8)=116280
bz(9)=203490
bz(10)=293930
bz(11)=352716
bz(22)=1
bz(21)=21
bz(20)=210
bz(19)=1330
bz(18)=5985
bz(17)=20349
bz(16)=54264
bz(15)=116280
bz(14)=203490
bz(13)=293930
bz(12)=352716
ENDIF
IF (Nold == 23)
bz(1)=1
bz(2)=22
bz(3)=231
bz(4)=1540
bz(5)=7315
bz(6)=26334
bz(7)=74613
bz(8)=170544
bz(9)=319770
bz(10)=497420
bz(11)=646646
bz(23)=1
bz(22)=22
bz(21)=231
bz(20)=1540
bz(19)=7315
bz(18)=26334
bz(17)=74613
bz(16)=170544
bz(15)=319770
bz(14)=497420
bz(13)=646646
bz(12)=705432
ENDIF
IF (Nold == 24)
bz(1)=1
bz(2)=23
bz(3)=253
bz(4)=1771
bz(5)=8855
bz(6)=33649
bz(7)=100947
bz(8)=245157
bz(9)=490314
bz(10)=817190
bz(11)=1144066
bz(12)=1352078
bz(24)=1
bz(23)=23
bz(22)=253
bz(21)=1771
bz(20)=8855
bz(19)=33649
bz(18)=100947
bz(17)=245157
bz(16)=490314
bz(15)=817190
bz(14)=1144066
bz(13)=1352078
ENDIF
IF (Nold == 25)
bz(1)=1
bz(2)=24
bz(3)=276
bz(4)=2024
bz(5)=10626
bz(6)=42504
bz(7)=134596
bz(8)=346104
bz(9)=735471
bz(10)=1307504
bz(11)=1961256
bz(12)=2496144
bz(25)=1
bz(24)=24
bz(23)=276
bz(22)=2024
bz(21)=10626
bz(20)=42504
bz(19)=134596
bz(18)=346104
bz(17)=735471
bz(16)=1307504
bz(15)=1961256
bz(14)=2496144
bz(13)=2704156
ENDIF
IF (Nold == 26)
bz(1)=1
bz(2)=25
bz(3)=300
bz(4)=2300
bz(5)=12650
bz(6)=53130
bz(7)=177100
bz(8)=480700
bz(9)=1081575
bz(10)=2042975
bz(11)=3268760
bz(12)=4457400
bz(13)=5200300
bz(26)=1
bz(25)=25
bz(24)=300
bz(23)=2300
bz(22)=12560
bz(21)=53130
bz(20)=177100
bz(19)=480700
bz(18)=1081575
bz(17)=2042975
bz(16)=3268760
bz(15)=4457400
bz(14)=5200300
ENDIF
IF (Nold == 27)
bz(1)=1
bz(2)=26
bz(3)=325
bz(4)=2600
bz(5)=14950
bz(6)=65780
bz(7)=230230
bz(8)=657800
bz(9)=1562275
bz(10)=3124550
bz(11)=5311735
bz(12)=7726160
bz(13)=9657700
bz(27)=1
bz(26)=26
bz(25)=325
bz(24)=2600
bz(23)=14950
bz(22)=65780
bz(21)=230230
bz(20)=657800
bz(19)=1562275
bz(18)=3124550
bz(17)=5311735
bz(16)=7726160
bz(15)=9657700
bz(14)=10400600
ENDIF
IF (Nold == 28)
bz(1)=1
bz(2)=27
bz(3)=351
bz(4)=2925
bz(5)=17550
bz(6)=80730
bz(7)=296010
bz(8)=888030
bz(9)=2220075
bz(10)=4686825
bz(11)=8436285
bz(12)=13037895
bz(13)=17383860
bz(14)=20058300
bz(28)=1
bz(27)=27
bz(26)=351
bz(25)=2925
bz(24)=17550
bz(23)=80730
bz(22)=296010
bz(21)=888030
bz(20)=2220075
bz(19)=4686825
bz(18)=8436285
bz(17)=13037895
bz(16)=17383860
bz(15)=20058300
ENDIF
IF (Nold == 29)
bz(1)=1
bz(2)=28
bz(3)=378
bz(4)=3276
bz(5)=20475
bz(6)=98280
bz(7)=376740
bz(8)=1184040
bz(9)=3108105
bz(10)=6906900
bz(11)=13123110
bz(12)=21474180
bz(13)=30421755
bz(14)=37442160
bz(29)=1
bz(28)=28
bz(27)=378
bz(26)=3276
bz(25)=20475
bz(24)=98280
bz(23)=376740
bz(22)=1184040
bz(21)=3108105
bz(20)=6906900
bz(19)=13123110
bz(18)=21474180
bz(17)=30421755
bz(16)=37442160
bz(15)=40116600
ENDIF
IF (Nold == 30)
bz(1)=1
bz(2)=29
bz(3)=406
bz(4)=3654
bz(5)=23751
bz(6)=118755
bz(7)=475020
bz(8)=1560780
bz(9)=4292145
bz(10)=10015005
bz(11)=20030010
bz(12)=34597290
bz(13)=51895935
bz(14)=67863915
bz(15)=77558760
bz(30)=1
bz(29)=29
bz(28)=406
bz(27)=3654
bz(26)=23751
bz(25)=118755
bz(24)=475020
bz(23)=1560780
bz(22)=4292145
bz(21)=10015005
bz(20)=20030010
bz(19)=34597290
bz(18)=51895935
bz(17)=67863915
bz(16)=77558760
ENDIF
IF (Nold == 31)
bz(1) = 1
bz(2) = 30
bz(3) = 435
bz(4) = 4060
bz(5) = 27405
bz(6) = 142506
bz(7) = 593775
bz(8) = 2035800
bz(9) = 5852925
bz(10) = 14307150
bz(11) = 30045015
bz(12) = 54627300
bz(13) = 86493225
bz(14) = 119759850
bz(15) = 145422675
bz(16) = 155117520
bz(17) = 145422675
bz(18) = 119759850
bz(19) = 86493225
bz(20) = 54627300
bz(21) = 30045015
bz(22) = 14307150
bz(23) = 5852925
bz(24) = 2035800
bz(25) = 593775
bz(26) = 142506
bz(27) = 27405
bz(28) = 4060
bz(29) = 435
bz(30) = 30
bz(31) = 1
ENDIF
IF (Nold == 32)
bz(1) = 1
bz(2) = 31
bz(3) = 465
bz(4) = 4495
bz(5) = 31465
bz(6) = 169911
bz(7) = 736281
bz(8) = 2629575
bz(9) = 7888725
bz(10) = 20160075
bz(11) = 44352165
bz(12) = 84672315
bz(13) = 141120525
bz(14) = 206253075
bz(15) = 265182525
bz(16) = 300540195
bz(17) = 300540195
bz(18) = 265182525
bz(19) = 206253075
bz(20) = 141120525
bz(21) = 84672315
bz(22) = 44352165
bz(23) = 20160075
bz(24) = 7888725
bz(25) = 2629575
bz(26) = 736281
bz(27) = 169911
bz(28) = 31465
bz(29) = 4495
bz(30) = 465
bz(31) = 31
bz(32) = 1
ENDIF
IF (Nold == 33)
bz(1) = 1
bz(2) = 32
bz(3) = 496
bz(4) = 4960
bz(5) = 35960
bz(6) = 201376
bz(7) = 906192
bz(8) = 3365856
bz(9) = 10518300
bz(10) = 28048800
bz(11) = 64512240
bz(12) = 129024480
bz(13) = 225792840
bz(14) = 347373600
bz(15) = 471435600
bz(16) = 565722720
bz(17) = 601080390
bz(18) = 565722720
bz(19) = 471435600
bz(20) = 347373600
bz(21) = 225792840
bz(22) = 129024480
bz(23) = 64512240
bz(24) = 28048800
bz(25) = 10518300
bz(26) = 3365856
bz(27) = 906192
bz(28) = 201376
bz(29) = 35960
bz(30) = 4960
bz(31) = 496
bz(32) = 32
bz(33) = 1
ENDIF
IF (Nold == 34)
bz(1) = 1
bz(2) = 33
bz(3) = 528
bz(4) = 5456
bz(5) = 40920
bz(6) = 237336
bz(7) = 1107568
bz(8) = 4272048
bz(9) = 13884156
bz(10) = 38567100
bz(11) = 92561040
bz(12) = 193536720
bz(13) = 354817320
bz(14) = 573166440
bz(15) = 818809200
bz(16) = 1037158320
bz(17) = 1166803110
bz(18) = 1166803110
bz(19) = 1037158320
bz(20) = 818809200
bz(21) = 573166440
bz(22) = 354817320
bz(23) = 193536720
bz(24) = 92561040
bz(25) = 38567100
bz(26) = 13884156
bz(27) = 4272048
bz(28) = 1107568
bz(29) = 237336
bz(30) = 40920
bz(31) = 5456
bz(32) = 528
bz(33) = 33
bz(34) = 1
ENDIF
IF (Nold == 35)
bz(1) = 1
bz(2) = 34
bz(3) = 561
bz(4) = 5984
bz(5) = 46376
bz(6) = 278256
bz(7) = 1344904
bz(8) = 5379616
bz(9) = 18156204
bz(10) = 52451256
bz(11) = 131128140
bz(12) = 286097760
bz(13) = 548354040
bz(14) = 927983760
bz(15) = 1391975640
bz(16) = 1855967520
bz(17) = 2203961430
bz(18) = 2333606220
bz(19) = 2203961430
bz(20) = 1855967520
bz(21) = 1391975640
bz(22) = 927983760
bz(23) = 548354040
bz(24) = 286097760
bz(25) = 131128140
bz(26) = 52451256
bz(27) = 18156204
bz(28) = 5379616
bz(29) = 1344904
bz(30) = 278256
bz(31) = 46376
bz(32) = 5984
bz(33) = 561
bz(34) = 34
bz(35) = 1
ENDIF
IF (Nold == 36)
bz(1) = 1
bz(2) = 35
bz(3) = 595
bz(4) = 6545
bz(5) = 52360
bz(6) = 324632
bz(7) = 1623160
bz(8) = 6724520
bz(9) = 23535820
bz(10) = 70607460
bz(11) = 183579396
bz(12) = 417225900
bz(13) = 834451800
bz(14) = 1476337800
bz(15) = 2319959400
bz(16) = 3247943160
bz(17) = 4059928950
bz(18) = 4537567650
bz(19) = 4537567650
bz(20) = 4059928950
bz(21) = 3247943160
bz(22) = 2319959400
bz(23) = 1476337800
bz(24) = 834451800
bz(25) = 417225900
bz(26) = 183579396
bz(27) = 70607460
bz(28) = 23535820
bz(29) = 6724520
bz(30) = 1623160
bz(31) = 324632
bz(32) = 52360
bz(33) = 6545
bz(34) = 595
bz(35) = 35
bz(36) = 1
ENDIF
IF (Nold == 37)
bz(1) = 1
bz(2) = 36
bz(3) = 630
bz(4) = 7140
bz(5) = 58905
bz(6) = 376992
bz(7) = 1947792
bz(8) = 8347680
bz(9) = 30260340
bz(10) = 94143280
bz(11) = 254186856
bz(12) = 600805296
bz(13) = 1251677700
bz(14) = 2310789600
bz(15) = 3796297200
bz(16) = 5567902560
bz(17) = 7307872110
bz(18) = 8597496600
bz(19) = 9075135300
bz(20) = 8597496600
bz(21) = 7307872110
bz(22) = 5567902560
bz(23) = 3796297200
bz(24) = 2310789600
bz(25) = 1251677700
bz(26) = 600805296
bz(27) = 254186856
bz(28) = 94143280
bz(29) = 30260340
bz(30) = 8347680
bz(31) = 1947792
bz(32) = 376992
bz(33) = 58905
bz(34) = 7140
bz(35) = 630
bz(36) = 36
bz(37) = 1
ENDIF
IF (Nold == 38)
bz(1) = 1
bz(2) = 37
bz(3) = 666
bz(4) = 7770
bz(5) = 66045
bz(6) = 435897
bz(7) = 2324784
bz(8) = 10295472
bz(9) = 38608020
bz(10) = 124403620
bz(11) = 348330136
bz(12) = 854992152
bz(13) = 1852482996
bz(14) = 3562467300
bz(15) = 6107086800
bz(16) = 9364199760
bz(17) = 12875774670
bz(18) = 15905368710
bz(19) = 17672631900
bz(20) = 17672631900
bz(21) = 15905368710
bz(22) = 12875774670
bz(23) = 9364199760
bz(24) = 6107086800
bz(25) = 3562467300
bz(26) = 1852482996
bz(27) = 854992152
bz(28) = 348330136
bz(29) = 124403620
bz(30) = 38608020
bz(31) = 10295472
bz(32) = 2324784
bz(33) = 435897
bz(34) = 66045
bz(35) = 7770
bz(36) = 666
bz(37) = 37
bz(38) = 1
ENDIF
IF (Nold == 39)
bz(1) = 1
bz(2) = 38
bz(3) = 703
bz(4) = 8436
bz(5) = 73815
bz(6) = 501942
bz(7) = 2760681
bz(8) = 12620256
bz(9) = 48903492
bz(10) = 163011640
bz(11) = 472733756
bz(12) = 1203322288
bz(13) = 2707475148
bz(14) = 5414950296
bz(15) = 9669554100
bz(16) = 15471286560
bz(17) = 22239974430
bz(18) = 28781143380
bz(19) = 33578000610
bz(20) = 35345263800
bz(21) = 33578000610
bz(22) = 28781143380
bz(23) = 22239974430
bz(24) = 15471286560
bz(25) = 9669554100
bz(26) = 5414950296
bz(27) = 2707475148
bz(28) = 1203322288
bz(29) = 472733756
bz(30) = 163011640
bz(31) = 48903492
bz(32) = 12620256
bz(33) = 2760681
bz(34) = 501942
bz(35) = 73815
bz(36) = 8436
bz(37) = 703
bz(38) = 38
bz(39) = 1
ENDIF
IF (Nold == 40)
bz(1) = 1
bz(2) = 39
bz(3) = 741
bz(4) = 9139
bz(5) = 82251
bz(6) = 575757
bz(7) = 3262623
bz(8) = 15380937
bz(9) = 61523748
bz(10) = 211915132
bz(11) = 635745396
bz(12) = 1676056044
bz(13) = 3910797436
bz(14) = 8122425444
bz(15) = 15084504396
bz(16) = 25140840660
bz(17) = 37711260990
bz(18) = 51021117810
bz(19) = 62359143990
bz(20) = 68923264410
bz(21) = 68923264410
bz(22) = 62359143990
bz(23) = 51021117810
bz(24) = 37711260990
bz(25) = 25140840660
bz(26) = 15084504396
bz(27) = 8122425444
bz(28) = 3910797436
bz(29) = 1676056044
bz(30) = 635745396
bz(31) = 211915132
bz(32) = 61523748
bz(33) = 15380937
bz(34) = 3262623
bz(35) = 575757
bz(36) = 82251
bz(37) = 9139
bz(38) = 741
bz(39) = 39
bz(40) = 1
ENDIF
interval=length/(Nnew-1)
FOR k,1,Nnew,1
xv=0
t=interval*(k-1)/length
FOR j,0,Nold-1,1
xv=xv+bz(j+1)*xa(j+1)*POWR(t,j)*POWR(1-t,Nold-j-1)
NEXT j
SETNSCPARAMETER 1, obj, STRT_PAR+k, xv
PRINT "Новая точка ", k, " ", xv
NEXT k
SETNSCPARAMETER 1, obj, 4, Nnew
LABEL 1