I copied this code to test file and remaned as grate.pmlftm. I copied this grate file pmllib.
I used show!!mangrate. The form is cameup, I fiiled the information as you indicated but Im getting following error. Please let me know how to execute this code.
[QUOTE=Bobby;91835]Thks wtiewtan.
Sure, can be done with pane & sctn. then you can calc. CoG/weight for platform...
my purpose is to model & for review only. With primitives, its easy to create hole/kickplate.
[ATTACH=CONFIG]8199[/ATTACH]
[COLOR=#333333]Thks wtiewtan.[/COLOR]
[COLOR=#333333]Sure, can be done with pane & sctn. then you can calc. CoG/weight for platform...[/COLOR]
[COLOR=#333333]my purpose is to model & for review only. With primitives, its easy to create hole/kickplate.[/COLOR]
Hi Bobby,
Could you please give the macro for making hole in the platform..
[QUOTE=mansyur.usm;91869]please see this pml syntax below :
-- Mansyur Usman (mansyur.usm@gmail.com)
-- PML for Creating Grate for Structure
setup form !!mangrate size 37.5 15
Var !UserName Login
Var !UserName UpCase(|$!UserName|)
!THIS.FORMTITLE = 'Gratting Form for $!UserName'
path d
text .LX 'Panjang Gratting ' at 0 1 width 10 is REAL
text .LY 'Lebar Gratting ' at 0 2 width 10 is REAL
text .PW 'Tinggi Gratting ' at 0 3 width 10 is REAL
text .PT 'Tebal Plate ' at 0 4 width 10 is REAL
text .BSIZE 'Plate Horizontal ' at 0 5 width 10 is REAL
text .PX'Space Plate Horizontal' at 0 6 width 10 is REAL
text .PY'Space Plate Vertical ' at 0 7 width 10 is REAL
text .NM'Nama Plate' at 0 8 width 22 is STRING
frame .framepos 'Coordinat' at 0 9
button .create 'Create' at 0.5 1 callback '!this.kerjakan()' backg green
button .pickPos 'Position' at 23 1 callback '!this.pickPosition()' backg pink
text .position 'Pos' at 0 3 width 28 is string
!IntX = INT ($!LX / $!PX)
!IntY = INT ($!LY / $!PY)
NEW STRUC
NAME /'$!NM'
NEW SUBS
NEW BOX XLEN $!PT YLEN $!LY ZLEN $!PW
BY X ($!PT / 2) Y ($!LY / 2) Z ($!PW / 2)
DO !x FROM 1 TO ($!IntX - 1)
NEW BOX XLEN $!PT YLEN ($!LY - $!PT * 2) ZLEN $!PW
BY X ($!PX * $!x + $!PT / 2) Y ($!LY / 2) Z ($!PW / 2)
ENDDO
NEW BOX XLEN $!PT YLEN $!LY ZLEN $!PW
BY X ($!LX - $!PT / 2) Y ($!LY / 2) Z ($!PW / 2)
NEW BOX XLEN $!LX YLEN $!PT ZLEN $!PW
BY X ($!LX / 2) Y ($!PT / 2) Z ($!PW / 2)
DO !y FROM 1 TO ($!IntY - 1)
-- NEW BOX XLEN $!LX YLEN $!BSIZE ZLEN $!BSIZE
NEW CYLI DIA $!BSIZE HEI $!LX
ORI Y IS N AND Z IS E
BY X ($!LX / 2) Y ($!PY * $!y + $!PT / 2) Z ($!PW - $!BSIZE / 2)
ENDDO
NEW BOX XLEN $!LX YLEN $!PT ZLEN $!PW
BY X ($!LX / 2) Y ($!LY - $!PT / 2) Z ($!PW / 2)
SUBS
endmethod
define method .pickPosition()
-- Object Format to Control Decimal Precision.
!format = object format()
!format.dp = 1
prompt dismiss
prompt off
prompt load escape 'Identify Element as Reference Position...'
var !pick pick
handle any
prompt on
return
endhandle
prompt on
!dbref = !pick[1].dbref()
if (!dbref.hardtype.eq('SCTN') or !dbref.hardtype.eq('GENSEC')) then
-- Get a LINE that represents the Start & End.
!line = !dbref.pose.line(!dbref.poss)
-- Get a POINTVECTOR from the picked Element informations.
!pickPos = object position(!pick[2].after(|Through|))
!pickDir = object direction(!pick[2].after(|Line|).before(|Through|))
!pVector = object pointvector(!pickPos, !pickDir)
-- Derived the POSITION Picked along the SCTN.
!pickPos = !line.intersection(!pVector)
-- Get which is the Nearest (End or Start).
if (!dbref.poss.distance(!pickPos).leq(!dbref.pose.distance(!pickPos))) then
-- Position is at the START.
!panePos = !dbref.poss.wrt(world)
else
-- Position is at the END
!panePos = !dbref.pose.wrt(world)
endif
else
-- Position is at the Origin of the Picked Element.
!panePos = !dbref.position.wrt(world)
endif
-- Set Value to Position:
!this.position.val = !panePos.string(!format)
axes at $!panePos
endmethod
[COLOR=#333333]Hi, if I wanna modify the grating plate later, may I Modify them like modify a Box ?[/COLOR]
hi
I am new user in PDMS. So I want to use your grating macro. can you describe how will use that macro. And can I gratin bar spacing and can I put opening if yes how I will do?