×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# APDL Parametric model

## APDL Parametric model

(OP)
Hello,

I am trying to make a parametric model of a honeycomb sandwich structure. I have difficulty creating the geometry of the core and the plates using APDL. I want the panel to be completely parametric so changes in the geometry can happen without any problem. Can anyone assist me with that?
Part of my code is the one attached, but it doesn't work as intended.

PREVIOUS STEP IS TO CREATE THE PARAMETERS

!=====CREATING KEYPOINTS======
k,1,0,0,0
k,2,0,0,h
k,3,l*cos(theta),0,h+l*sin(theta)
k,4,l*cos(theta),0,3*h/2+l*sin(theta)
k,5,2*l*cos(theta),0,h
k,6,2*l*cos(theta),0,0
k,7,l*cos(theta),0,-l*sin(theta)
k,8,l*cos(theta),0,-l*sin(theta)-h/2
k,9,0,d,0
k,10,0,d,h
k,11,l*cos(theta),d,h+l*sin(theta)
k,12,l*cos(theta),d,3*h/2+l*sin(theta)
k,13,2*l*cos(theta),d,h
k,14,2*l*cos(theta),d,0
k,15,l*cos(theta),d,-l*sin(theta)
k,16,l*cos(theta),d,-l*sin(theta)-h/2

!===LINES GENERATION====
LSTR,1,2
LSTR,2,3
LSTR,3,4
LSTR,3,5
LSTR,5,6
LSTR,6,7
LSTR,7,8
LSTR,7,1
LSTR,9,10
LSTR,10,11
LSTR,11,12
LSTR,11,13
LSTR,13,14
LSTR,14,15
LSTR,15,16
LSTR,15,9
LSTR,9,1
LSTR,10,2
LSTR,11,3
LSTR,12,4
LSTR,13,5
LSTR,14,6
LSTR,15,7
LSTR,16,8

!====AREA OF THE CORE====

AL,5,22,21,13
AL,6,22,23,14
AL,23,8,17,16
AL,17,9,18,1
AL,18,10,19,2
AL,11,20,3,19
AL,19,4,21,12
AL,15,23,7,24

!===GENARATE THE GEOMETRY===
AGEN,n,1,8 ,0 ,0,0,-2*h-2*l*sin(theta),0
AGEN,2,1,8,0,-l*cos(theta),0,(-2*h-2*l*sin(theta))/2,0
AGEN,N1,25,32,0,0,0,-2*h-2*l*sin(theta),0
AGEN,N2,1,8,0,-2*l*cos(theta),0,0,0
AGEN,N2-1,25,32,0,-2*l*cos(theta),0,0,0
AGEN,N2,9,16,0,-2*l*cos(theta),0,0,0
AGEN,N2-1,33,40,0,-2*l*cos(theta),0,0,0
AGEN,N2,17,24,0,-2*l*cos(theta),0,0,0
AGEN,N2-1,41,48,0,-2*l*cos(theta),0,0,0
AGEN,N1,25,32,0,0,0,-2*h-2*l*sin(theta),0
AATT,1,,1,0,1

!===CREATING ADDITIONAL KEYPOINTS FOR THE PLATES====
K,20001,2*l*cos(theta),0,(1.5*h+l*sin(theta))
K,20002,-N2*(2*l*cos(theta)),0,(1.5*h+l*sin(theta))
K,20003,2*l*cos(theta),0,-N1*2*(h+l*sin(theta))
K,20004,-N2*(2*l*cos(theta)),0,-N1*2*(h+l*sin(theta))

!====CREATING BOTTOM PLATE====
A,20001,20002,20004,20003

K,20005,2*l*cos(theta),d,(1.5*h+l*sin(theta))
K,20006,-N2*(2*l*cos(theta)),d,(1.5*h+l*sin(theta))
K,20007,2*l*cos(theta),d,-N1*2*(h+l*sin(theta))
K,20008,-N2*(2*l*cos(theta)),d,-N1*2*(h+l*sin(theta))

!=====CREATING TOP PLATE====
A,20005,20006,20008,20007

Thanks,
Antonis

### RE: APDL Parametric model

You need to introduce parameters in your macro/script/code for the dimensions to be parametrized. Such as for rectangle define width=x mm and length=y mm as parameters. For honeycomb structure, you cam make the sketch first in the Mechanical APDL and with the help of "session editor", where whatever you do in GUI is recorded in commands, you can create your script easily. You need some basic information on commands and their syntax.

You can refer Ansys's "Command Reference" guide for commands and "ANSYS Parametric Design Language Guide" for more information on parametric models.

### RE: APDL Parametric model

(OP)

I am familiar with this kind of process, my problem has to do with the generation of the honeycomb geometry. I can create a basic geometry but it doesn't always give the desired geometry. Below you can see part of my code for the generation. Do you think there is a way to code the generation of the core with specific parameters?

thanks again!
PREVIOUS STEP IS TO CREATE THE PARAMETERS

!=====CREATING KEYPOINTS======
k,1,0,0,0
k,2,0,0,h
k,3,l*cos(theta),0,h+l*sin(theta)
k,4,l*cos(theta),0,3*h/2+l*sin(theta)
k,5,2*l*cos(theta),0,h
k,6,2*l*cos(theta),0,0
k,7,l*cos(theta),0,-l*sin(theta)
k,8,l*cos(theta),0,-l*sin(theta)-h/2
k,9,0,d,0
k,10,0,d,h
k,11,l*cos(theta),d,h+l*sin(theta)
k,12,l*cos(theta),d,3*h/2+l*sin(theta)
k,13,2*l*cos(theta),d,h
k,14,2*l*cos(theta),d,0
k,15,l*cos(theta),d,-l*sin(theta)
k,16,l*cos(theta),d,-l*sin(theta)-h/2

!===LINES GENERATION====
LSTR,1,2
LSTR,2,3
LSTR,3,4
LSTR,3,5
LSTR,5,6
LSTR,6,7
LSTR,7,8
LSTR,7,1
LSTR,9,10
LSTR,10,11
LSTR,11,12
LSTR,11,13
LSTR,13,14
LSTR,14,15
LSTR,15,16
LSTR,15,9
LSTR,9,1
LSTR,10,2
LSTR,11,3
LSTR,12,4
LSTR,13,5
LSTR,14,6
LSTR,15,7
LSTR,16,8

!====AREA OF THE CORE====

AL,5,22,21,13
AL,6,22,23,14
AL,23,8,17,16
AL,17,9,18,1
AL,18,10,19,2
AL,11,20,3,19
AL,19,4,21,12
AL,15,23,7,24

!===GENARATE THE GEOMETRY===
AGEN,n,1,8 ,0 ,0,0,-2*h-2*l*sin(theta),0
AGEN,2,1,8,0,-l*cos(theta),0,(-2*h-2*l*sin(theta))/2,0
AGEN,N1,25,32,0,0,0,-2*h-2*l*sin(theta),0
AGEN,N2,1,8,0,-2*l*cos(theta),0,0,0
AGEN,N2-1,25,32,0,-2*l*cos(theta),0,0,0
AGEN,N2,9,16,0,-2*l*cos(theta),0,0,0
AGEN,N2-1,33,40,0,-2*l*cos(theta),0,0,0
AGEN,N2,17,24,0,-2*l*cos(theta),0,0,0
AGEN,N2-1,41,48,0,-2*l*cos(theta),0,0,0
AGEN,N1,25,32,0,0,0,-2*h-2*l*sin(theta),0
AATT,1,,1,0,1

!===CREATING ADDITIONAL KEYPOINTS FOR THE PLATES====
K,20001,2*l*cos(theta),0,(1.5*h+l*sin(theta))
K,20002,-N2*(2*l*cos(theta)),0,(1.5*h+l*sin(theta))
K,20003,2*l*cos(theta),0,-N1*2*(h+l*sin(theta))
K,20004,-N2*(2*l*cos(theta)),0,-N1*2*(h+l*sin(theta))

!====CREATING BOTTOM PLATE====
A,20001,20002,20004,20003

K,20005,2*l*cos(theta),d,(1.5*h+l*sin(theta))
K,20006,-N2*(2*l*cos(theta)),d,(1.5*h+l*sin(theta))
K,20007,2*l*cos(theta),d,-N1*2*(h+l*sin(theta))
K,20008,-N2*(2*l*cos(theta)),d,-N1*2*(h+l*sin(theta))

!=====CREATING TOP PLATE====
A,20005,20006,20008,20007

### RE: APDL Parametric model

I would suggest to define parameter for l*cos(theta)=lcos and l*sin(theta)=lsin and then using it in the commands. Do the mathematical operations and define parameter for the same and use that parameter variable later in commands.

Check whether there is requirement of only integers in commands.

### RE: APDL Parametric model

(OP)
Yes, I can do all that. But how can I create a 'routine' for the generation of the model? For example, if I want the length and the width of the specimen to be different each time. That's where my problem lies.

### RE: APDL Parametric model

If you define length =x mm and width = y mm, I do not see you will need to worry about the change in dimensions. Or rather I am unable to see what exactly is your concern. Can you elaborate?

### RE: APDL Parametric model

(OP)
My script now creates a specimen with the specific dimensions and doesn't produce accurate models if the dimensions change. this script doesn't generate an accurate number of unit cells in the core. I don't know if you understand what I am trying to explain .
In general, I want a script that when you run produces a core with a number of unit cells and the two faceplates, but I cannot find a way to accurately generate the geometry of my problem.

### RE: APDL Parametric model

You need to rectify the script. Maybe you have created script using session editor that may be using the GUI commands that you have not changed. Try executing each command after changing dimensions and see at what command it goes wrong.

Also there is limitations of dimensions range that can be changed if you made the script with particular shape in mind (as in your case becoming specific to certain dimensions). Otherwise the remaining commands will not work and produce erratic results. For example- If I want rectangle to be horizontally longer, I need to give length>width. But if I give instead width>length, rectangle will be vertically longer and the command which will work correctly when length>width will produce erratic results.

Check whether that is case in your script.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!