If you are trying to mount a rear rim from your CB550 to a front hub that is a disc hub, you will find that you'll need spokes that are about 1/2" shorter. But, the problem would be that your 18" REAR rim is drilled for a drum hub that is much larger in diameter than the disc hub would be. You could lace it up, but you would find that the holes are drilled differently - meaning, the spokes angles would not match properly. The spokes would have to bend a bit at the holes in order to get the correct angle back to the hub. People have done it. Just not the best idea - it creates more stress on the spoke.
You can change your rear rim from the stock CB550 rim to a CB750 rim using the same spokes.
Yamaha XS650 had 36 spoke rims and hubs that are easily found. MikesXS online has spoke kits for those