AutoCAD Plant 3D Forum
Welcome to Autodesk’s AutoCAD Plant 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Plant 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modified D3 diameter for Ball/Globe valves do not adopt accordingly value in the catalog/spec

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
rudy.coupe
310 Views, 6 Replies

Modified D3 diameter for Ball/Globe valves do not adopt accordingly value in the catalog/spec

How to get influence on the D3 diameter parameter for Globe (and Ball) valves. At this moment de ball diameter does not change, whatever value is entered in the catalog/specs. Is this a drawing script issue/bug? Any idea how to change it. Ball valves and globe valve having the same 3D representation, which have in common practice a different 3D representation. The ball diameter for Globe valves normally is much smaller as for the Ball valves.

Rudy C. - PDCAD Consultancy.

6 REPLIES 6
Message 2 of 7
h_eger
in reply to: rudy.coupe

Dear @rudy.coupe ,

 

As long as old valves with the old D3 dimensions are still in the drawing, the old block is always used.
Remove all valves from the drawing, purge them and remove only the blocks.

 

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



Message 3 of 7
rudy.coupe
in reply to: rudy.coupe

Thanks Hartmut for the quick response, however I still see a strange behavior. I started a new drawing to see what happens with the D3 parameter. See picture where I used a DN100 (114.3mm) globe valve. When decreasing the value below 130, it becomes bigger ?? It is an improvement till that particular value, but where does it come from? how to calculate the smallest allowable D3 parameter? Why not making it flexible till whatever diameter of the sphere? Does this work also in 2022 version? (Using 2023 at this moment, but my customerGlobe valve DN100.png is using 2022)

Thanks in advance, Rudy C. PDCAD Consultancy.

Message 4 of 7
h_eger
in reply to: rudy.coupe

because the value for D3 is automatically calculated when 0 is entered.
You can see the formula in the picture.

30-08-_2022_15-18-39.jpg

 

Enclosed are the Python scripts

 

Python CPVI004000

# Embedded file name: varmain\valvsub\cpvi004sub\cpvi004000sub\cpvi004000.pyc
from aqa.math import *
from varmain.primitiv import *
from varmain.flangesub.cpflo import *
from varmain.valvsub.cpvi004sub.cpvi004_util import *
from varmain.var_basic import *

def CPVI004000(s, D1 = 114.3, D2 = 0.0, L = 350.0, LS = 0.0, H1 = 220.0, H2 = 0.0, D3 = 0.0, W1 = 0.0, W2 = 0.0, OF = -1.0, B1 = 22.0, B2 = 0.0, ID = 'CPVI004000', **kw):
    vC = CPVI004CORRV(D1=D1, D2=D2, L=L, LS=LS, H1=H1, H2=H2, D3=D3, B1=B1, B2=B2, W1=W1, W2=W2, OF=OF, L1=0.0, L2=0.0, I1=None, I2=None)
    R1 = vC[38] / 2.0
    R2 = vC[40] / 2.0
    R3 = vC[0] / 2.0
    R4 = vC[1] / 2.0
    if vC[30] > 0.0:
        oF1 = CPFLO(s, L=vC[30], D1=vC[38], D2=(R3 - vC[17]) * 2.0, W=vC[39]).rotateX(vC[36])
    else:
        oF1 = None
    if vC[31] > 0.0:
        oF2 = CPFLO(s, L=vC[31], D1=vC[40], D2=(R4 - vC[17]) * 2.0, W=vC[41]).rotateX(vC[37]).translate((vC[3] + vC[4] + vC[30], 0, 0))
    else:
        oF2 = None
    oC1 = CONE(s, R1=R1, R2=0.0, H=vC[3]).rotateY(90).translate((vC[30], 0.0, 0.0))
    oC2 = CONE(s, R1=R2, R2=0.0, H=vC[4]).rotateY(-90).translate((vC[2] - vC[31], 0.0, 0.0))
    oC3 = SPHERE(s, R=vC[29]).translate((vC[30] + vC[3], 0, 0))
    sDist = vC[29] * 2.0
    if vC[2] - vC[30] - vC[31] < sDist:
        oS2 = BOX(s, L=sDist, W=sDist, H=vC[2] - vC[30] - vC[31]).translate((vC[30] + vC[3], 0, 0))
        oS2.intersectWith(oC3)
        oC3.erase()
        oC3 = oS2
    oC1.uniteWith(oC3)
    oC3.erase()
    oC1.uniteWith(oC2)
    oC2.erase()
    if oF1:
        oC1.uniteWith(oF1)
        oF1.erase()
    if oF2:
        oC1.uniteWith(oF2)
        oF2.erase()
    if vC[17] > 0.0:
        oC5 = CPVI004000_Drill(s, D1=vC[0], D2=vC[1], L1=vC[3], L2=vC[4], H1=vC[38], H2=vC[40], OF=vC[17]).translate((vC[30], 0.0, 0.0))
        oC1.subtractFrom(oC5)
        oC5.erase()
    s.setPoint(vC[11], vC[12], vC[36])
    s.setPoint(vC[13], vC[14], vC[37])
    return

 

CPVI0040000_util

# Embedded file name: varmain\valvsub\cpvi004sub\cpvi004_util.pyc
from aqa.math import *
from varmain.primitiv import *
from varmain.var_basic import *
from varmain.valvsub.cpv_util import *

def CPVI004CORRV(D1 = 1.0, D2 = 0.0, L = 1.0, LS = 0.0, H1 = 1.0, H2 = 0.0, D3 = 0.0, B1 = 0.0, B2 = 0.0, W1 = 0.0, W2 = 0.0, L1 = 0.0, L2 = 0.0, I1 = 0.0, I2 = 0.0, L31 = None, L32 = None, D31 = None, D32 = None, OF = -1.0):
    gV = CPVI_CORRV(D1=D1, D2=D2, L=L, LS=LS, H1=H1, H2=H2, B1=B1, B2=B2, W1=W1, W2=W2, L1=L1, L2=L2, I1=I1, I2=I2, L31=L31, L32=L32, D31=D31, D32=D32, OF=OF, ConeType=True)
    D1 = gV['D1']
    result = [D1]
    D2 = gV['D2']
    result.append(D2)
    L = gV['L']
    result.append(L)
    LS = gV['LS']
    result.append(LS)
    LP = gV['LP']
    result.append(LP)
    H1 = gV['H1']
    result.append(H1)
    H2 = gV['H2']
    result.append(H2)
    B1 = gV['B1']
    B2 = gV['B2']
    result.append(gV['L1'])
    result.append(gV['L2'])
    result.append(gV['sL1'])
    result.append(gV['sL2'])
    result.append(gV['P1'])
    result.append(gV['V1'])
    result.append(gV['P2'])
    result.append(gV['V2'])
    result.append(gV['noLeft'])
    result.append(gV['noRight'])
    OF = gV['OF']
    if OF <= 0.0:
        if D1 >= D2:
            sF = getThickness(D1, OF=OF, Ever=True, mustCalc=True)
        else:
            sF = getThickness(D2, OF=OF, Ever=True, mustCalc=True)
    else:
        sF = OF
    result.append(OF)
    result.append(gV['I1'])
    result.append(gV['I2'])
    result.append(gV['L31'])
    result.append(gV['L32'])
    result.append(gV['D31'])
    result.append(gV['D32'])
    result.append(gV['mL1'])
    result.append(gV['mL2'])
    result.append(gV['sI1'])
    result.append(gV['sI2'])
    if H1 > 0.0 and H1 > D1 + sF * 2.0:
        xH1 = H1
    else:
        xH1 = D1 * 2.0
    if H2 > 0.0 and H2 > D2 + sF * 2.0:
        xH2 = H2
    else:
        xH2 = D2 * 2.0
    if D3 <= 0.0:
        D3 = (xH1 + xH2) / 2.0
    if D3 <= D1 + sF * 2.0:
        D3 = xH1
    if D3 <= D2 + sF * 2.0:
        D3 = xH2
    result.append(D3)
    result.append(D3 / 2.0)
    result.append(B1)
    result.append(B2)
    R1 = D1 / 2.0
    R2 = D2 / 2.0
    R3 = D3 / 2.0
    rL1 = LS - sqrt(pow(R3, 2.0) - pow(R1, 2.0))
    rL2 = LP - sqrt(pow(R3, 2.0) - pow(R2, 2.0))
    result.append(rL1)
    result.append(rL2)
    result.append(gV['W1'])
    result.append(gV['W2'])
    result.append(gV['WA1'])
    result.append(gV['WA2'])
    result.append(gV['tH1'])
    result.append(gV['tW1'])
    result.append(gV['tH2'])
    result.append(gV['tW2'])
    return result


def CPVI004000_Drill(s, D1 = 0.0, D2 = 0.0, OF = 0.0, L1 = 0.0, L2 = 0.0, H1 = 0.0, H2 = 0.0, ID = 'CPVI004000_Drill', **kw):
    OF1 = getThickness(D=D1, OF=OF, Ever=1)
    OF2 = getThickness(D=D2, OF=OF, Ever=1)
    R01 = D1 / 2.0 - OF1
    R02 = D2 / 2.0 - OF2
    R04 = H1 / 2.0
    R05 = H2 / 2.0
    Lt1 = (R04 - R01) * tan(pi / 2.0 - atan(R04 / L1)) - OF1
    Lt2 = (R05 - R02) * tan(pi / 2.0 - atan(R05 / L2)) - OF2
    if Lt1 > 0.0:
        oC5 = CYLINDER(s, R=R01, H=Lt1, O=0.0).rotateY(90.0)
    else:
        oC5 = None
    if Lt2 > 0.0:
        oC6 = CYLINDER(s, R=R02, H=Lt2, O=0.0).rotateY(-90.0).translate((L1 + L2, 0.0, 0.0))
    else:
        oC6 = None
    if oC5 and oC6:
        oC5.uniteWith(oC6)
        oC6.erase()
    return


activate(CPVI004000_Drill)

def CPVI004_GetNeededBoltParam(**kw):
    basDat = CPVI_CORRV(D1=getParamVal(kw, 'D1'), D2=getParamVal(kw, 'D2'), L=getParamVal(kw, 'L'), LS=getParamVal(kw, 'LS'), H1=getParamVal(kw, 'H1'), H2=getParamVal(kw, 'H2'), B1=getParamVal(kw, 'B1'), B2=getParamVal(kw, 'B2'), W1=getParamVal(kw, 'W1'), W2=getParamVal(kw, 'W2'), L1=getParamVal(kw, 'L1'), L2=getParamVal(kw, 'L2'), I1=getParamVal(kw, 'I1'), I2=getParamVal(kw, 'I2'), L31=getParamVal(kw, 'L31'), L32=getParamVal(kw, 'L32'), D31=getParamVal(kw, 'D31'), D32=getParamVal(kw, 'D32'), OF=getParamVal(kw, 'OF'), ConeType=True)
    result = {'F_B': {0: basDat['B1'],
             1: basDat['B2']}}
    result['FXL'] = {0: basDat['L'],
     1: basDat['L']}
    result['_DC'] = {0: basDat['LS'],
     1: basDat['LP']}
    return result


linkFuncToDbman(CPVI004_GetNeededBoltParam)

 

 

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



Message 5 of 7
ed.pardonSXU3T
in reply to: rudy.coupe

Hello,

I did a little test in P3D 2017 version and this behavior was already in this version. This occurs especially with the “secondary” dimensions. This phenomenon is common in the scripts of P3D and especially with the screwed fittings you come across a factor of 1.0909. It looks like a bug but I think it was programmed on purpose. Gets a lot of annoyance because you're trying to get to the minimum level of detail without going into custom blocks or python.

Message 6 of 7
rudy.coupe
in reply to: h_eger

Thanks for this info, i have seen this already and wonder if i can comment out the lines 62-67 and replace the script?

Do we have a procedure to modify exsiting scripts and replacing them? What if we place an exact same (adopted) script in the custom folder, will it be used or does P3D still looks to the standard available script?

At this moment i beleive we can use the parameter knowing that we can enter a value *1.09, it was not easy to see, as in most cases the user expects whatever value here. 

Rudy C.

Message 7 of 7
rudy.coupe
in reply to: rudy.coupe

For the time being we can use this value of 1.0909, as this seems to have a better representation.

But it would be great to know how to have impact on it, see my questions about the script adoptions.

Thanks for the valuable info. 

Rudy C.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report