Hi,
I'm attemping to add 2 addition port to an Orifice flange and rotate the port 45deg around the flange OD.
Creating the graphics is pretty straight forward but i'm having dificulties defining the the addition ports and rotating the port 45 deg, see attached.
Inline ports 1 & 2 (FL & BV) are fine... Port 2 & 3 (THDF) seems to be define at angles 0 and 180 respectively. I've defined the additional port in the script and in the catalog, but they are not showing up in the parametric.
Any help would be greatly appreciated.
Your points and vectors for the connections are a little wonky. This should get you close to what you want for your connectors:
s.setPoint((0.0, 0.0, 0.0), (-1.0, 0.0, 0.0), 0.0) s.setPoint((L, 0.0, 0.0), (1.0, 0.0, 0.0), 0.0) s.setPoint((IL, (D1 / 2.0 - II) * cos(0.785398163), (D1 / 2.0 - II) * sin(0.785398163)), (0.0, 1.0, 1.0), 0.0) s.setPoint((IL, -(D1 / 2.0 - II) * cos(0.785398163), (D1 / 2.0 - II) * sin(0.785398163)), (0, -1.0, 1.0), 0.0) s.setPoint((IL, (D1 / 2.0 - II) * cos(0.785398163), -(D1 / 2.0 - II) * sin(0.785398163)), (0.0, 1.0, -1.0), 0.0) s.setPoint((IL, -(D1 / 2.0 - II) * cos(0.785398163), -(D1 / 2.0 - II) * sin(0.785398163)), (0, -1.0, -1.0), 0.0)
Thank so so very much! It works perfectly. I'm very new at this and still haven't got my head around the setPoints yet.
I'll have to break down what you've done to fully understand it, but thanks again, much appreciated.
Hi,
After watching your video are you able to explain how you associated your grips with the associated variables in your script so that the support would extend to the vessel wall?
I am working on a number of custom supports and want to be able to vary the support height to account for sloping pipe in pipe racks.
I have attached the one of the scripts I have produced, which so far which functions as I want in all other respects. I am using 'B' as the variable to initialy set the dimension from the bottom of pipe to the base of the support.
Thanks,
Roy
This is the line that sets the grip locations and stretch properties:
s.setLinearDimension('B',(0, 0, -R), (0, 0, -(B+OD/2)))
Try changing it to this and see if you get what you want:
s.setLinearDimension('B',(0, 0, -R1), (0, 0, -(B+R1)))
Hi again,
Thanks for looking at the script and locating the errors pointed out. After adjusting the script I am still unable to use the grip to adjust the height of the shoe however. Looking at the comand window I receive the following message.
"Geometry can not be generated with the given parameters.
Can't find symbol for specified part."
This is what I would expect from a calculation or coding error and should show up when running a Testacpscript comand. The program how ever geneates the item and only errors if I try to change a parameter value of the created item.
The same message is received if I type in a new value in the Properties window under the Dimensions sub heading. In fact, it happens if I try to change any of the values in the Dimensions sub heading.
I am begining to wonder if its a pathing issue when part being altered looks back to the creation script to see how it was made. The script is currently located in the following directory as directed by the little Autodesk University documentation I have been able to find.
C:\AutoCAD Plant 3D 2015 Content\CPak Common\CustomScripts
( http://aucache.autodesk.com/au2011/sessions/4214/datasets/v1_PD4214-L_Radhakrishnan_AnnexB_Custom%20... Page 46 note 3 )
Are you storing your scripts in the above location or at some other location such as in the VARIANTS.ZIP file under CPAK Common? I ask this as other documentation I have found online refers to decompiling existing scripts and restoring the altered script to the original locations.
Thanks,
Roy
Thanks for looking at this. After checking the script again I did find a couple of dimensional placement errors with the guide placement but nothing that would affect the grips operation.
In an effort to eliminate the need to check the entire script again I wrote a simple test script to see if my issues reoccured when starting from scratch. The test script consists of a box translated to the base of the pipe section. I then associated the setLinearDimension with the box height value BH.
I still have the same issues with not being able to stretch with the grip.
Hopefully this will make the problem more obvious.
The test script is attached.
Thanks,
Roy
Quick update,
I managed to get the attached script to work as I wanted.
I added an Ask4Dist flag to the BH parameter definition and increased the point acuracy of the variable definitions after setting them nomially to 1.000000 as a place holder value.
I set the desired dimentions for the finished items in the catalog editor.
I now will look harder at my other scripts now that I have have at least got the basics to work.
Thanks.
Hi again,
I've been doing a little scripting and was wondering if it is possible to add color to an object inside the script.
Dear roy,
This is my script, in which i tried to use stretch command
using line
s.setLinearDimension('H', (0, 0, 0), (0, 0, -H))
but it is not working.
Kindly guide me where i am going wrong
regards
import aqa.math
import math
from varmain.primitiv import *
from varmain.var_basic import *
from varmain.custom import *
@activate(Group="Support", TooltipShort="Single clamp saddle", TooltipLong="sliding support", LengthUnit="mm",Ports="1")
@group("MainDimensions")
@param(D=LENGTH, TooltipShort="Diameter")
@param(H=LENGTH, TooltipShort="Height of Saddle", Ask4Dist=True)
@group(Name="meaningless enum")
@enum(1, "align X")
@enum(2, "align Y")
@enum(3, "align Z")
#(arxload "PnP3dACPAdapter")
#(TESTACPSCRIPT "KRS1")
#-------------------------------------------------------------------
def TESTSTRE(s, D = 57.0, H=112.0, ID = 'TESTSTRE', **kw):
R1 = D / 2.0
o1=CYLINDER(s, R=R1, H=H, O=0.0)
s.setPoint((0.0, 0.0, 0.0), (0.0, 0.0, -1.0))
s.setLinearDimension('H', (0, 0, 0), (0, 0, -H))
Hi again Jabowabo,
I've asked about the on the forum, but haven't had a response from anyone. my question is in 3 parts.
First.
I've created custom parametric in the past that needed one of their parameter adjusted after insert from the spec. In the past I've added the "Custom" designator to the Component Designation field in the spec which usually works, but for some reason does not with this script, see attached.
If I change the group from valve to (@activate(Group="Elbow") it works fine but not with "Valve". Is Valve the correct group name for custom valves?
Second:
After see your code for the Vessel Pipe Guide I'm wondering if changing the Component Designation is the best way to adjust components after placement in the model. I've tried following your example but have not been successful, please advise.
Third.
I've created a custom valve actuator but I am not able to see it in the list of Operator shape when attempting to add it to a valve, see script attached.
If I can't add additional parametric shape is it possible to customize the existing ones.
Thanks in advance for any help you can give my questions.
Howard
1. I haven't attempted exactly what you are trying yet so I can't confirm. Seems like 'Valve' ought to work though. I think 'CUSTOM' is case sensitive so you may check that. I don't see your script attached so hard to know what other problem may exist.
2. The only way I have been able to use the stretch grips is with Supports.
3. This is a known issue - see here for operator info.
Hi,
could you tell me how the option "Ask4Dist=True" works?
Is it possible to use it to make a valve with custom face-to-face dimension?
Regards,
Per the documentation: "(Ask4Dist) that tells us its length may also be given by specifying a distance in the model."
I'm actually not sure this works at all as I haven't seen that it makes any difference. When we want to modify dimensions for items, we convert to a custom part which allows for modifying dimensions.